Instancing twice to get results [message #1717633] |
Tue, 15 December 2015 07:34  |
Eclipse User |
|
|
|
Hi,
I'm new to VIATRA and EMF-IncQuery. I'm trying a simple m2m transformation using the Incremental Transformation API and getting some strange behaviour.
For a m2m transformation with a simple rule like (it transforms a model Model element of the source metamodel into a Model element of the target metamodel):
val model2ModelRule = createRule.precondition(ModelMatcher::querySpecification).action(IncQueryActivationStateEnum.APPEARED) [
var newModel = outResource.create(model) as Model
newModel.name = m.name
createTrace(m, newModel)
].addLifeCycle(Lifecycles.getDefault(false, false)).build
With query:
pattern model(m : Model) {
Model(m);
}
If I run:
IncrementalSimpleUML2RDB transformation = new IncrementalSimpleUML2RDB(inRsc, outRsc);
transformation.transform();
I don't get any result in outRsc (the output resource). But if I run:
IncrementalSimpleUML2RDB transformation = new IncrementalSimpleUML2RDB(inRsc, outRsc);
transformation.transform();
transformation = new IncrementalSimpleUML2RDB(inRsc, outRsc);
transformation.transform();
I do get results.
So, what am I misunderstanding wrongly?
Many thanks in advance.
|
|
|
|
|
Re: Instancing twice to get results [message #1717659 is a reply to message #1717658] |
Tue, 15 December 2015 10:23  |
Eclipse User |
|
|
|
Hi,
yes, when there are multiple activations that can be fired in the same time, the conflict resolver decides which is executed next.
For most M2M use case, either the FixedPriority or the InverseDisappearanceFixedPriority resolvers are appropriate.
Cheers
|
|
|
Powered by
FUDForum. Page generated in 0.03876 seconds