|
|
|
Re: Input Model with references [message #1754665 is a reply to message #1754630] |
Tue, 21 February 2017 06:58   |
Eclipse User |
|
|
|
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 07:02] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.49181 seconds