|
Re: Input Model with references [message #1754596 is a reply to message #1754594] |
Mon, 20 February 2017 16:37 |
|
ATL traverses only the models you specify in the launch configuration (= Resources in EMF). You have to add all referenced models explicitly to your launch configuration (Run... -> ...); you don't necessarily have to specify them in the transformation module itself.
Cheers,
Dennis
|
|
|
|
Re: Input Model with references [message #1754665 is a reply to message #1754630] |
Tue, 21 February 2017 11:58 |
Thibault beziers la fosse Messages: 10 Registered: February 2017 |
Junior Member |
|
|
The transformation works well when I'm launching it with the EMFTVM Eclipse Run Configuration, but I'm having some issues when launching it programmatically, with Java.
I've this helper:
helper context MM!Statement def: lineNumber: Integer =
-- might need some optimization
let allNodes: Sequence(MM2!JavaNodeSourceRegion) =
MM2!JavaNodeSourceRegion.allInstances() -> asSequence()
in
if (allNodes -> select(node | node.node.debug() = self).size() > 0)
then
allNodes -> select(node | node.node = self).first().startLine.debug()
else
-1
endif
;
The debug() method will print lines as: 121f7d04:MM!ExpressionStatement with the emftvm launch configuration.
When running the transformation programmatically, the debug() method prints instead.
I'm loading the metamodels and the models in this order:
MM: http://www.eclipse.org/MoDisco/Java/0.2.incubation/java
MM2: http://www.eclipse.org/MoDisco/Java/Composition/0.1.incubation/javaApplication
MM1: /.../resources/testmetamodel.ecore
IN
all the java2kdm.xmi models
IN2
To load the Meta Models I use the following Java code:
Metamodel inMetamodel = EmftvmFactory.eINSTANCE.createMetamodel();
inMetamodel.setResource(resourceSet.getResource(URI.createURI(MMUri), true));
execEnv.registerMetaModel(name, inMetamodel);
To load the input models I use the following Java Code :
Model model = EmftvmFactory.eINSTANCE.createModel();
model.setAllowInterModelReferences(true);
model.setResource(resourceSet.getResource(URI.createURI(modelUri), true));
execEnv.registerInputModel(name, model);
And the output model:
Model model = EmftvmFactory.eINSTANCE.createModel();
model.setAllowInterModelReferences(true);
model.setResource(resourceSet.createResource(URI.createURI(modelUri)));
execEnv.registerOutputModel(name, model);
I have no error message in the standard output, and the transformation is completed, except the part using my helper.
Maybe I'm not clear enough. Tell me if you need more informations, or code sample.
If you have an idea, that would be very helpful.
T.
[Updated on: Tue, 21 February 2017 12:02] Report message to a moderator
|
|
|
Re: Input Model with references [message #1755028 is a reply to message #1754665] |
Mon, 27 February 2017 08:03 |
|
I see you're using multiple debug() calls: it's better to add a string parameter to debug() to see which debug() call is triggering (e.g. debug('first call')).
As for the actual problem: in which part of the Java meta model does ExpressionStatement reside? Is that part loaded properly?
Cheers,
Dennis
|
|
|
|
Powered by
FUDForum. Page generated in 0.04135 seconds