Empty XMI when running a transformation from an eclipse plugin [message #1753173] |
Thu, 02 February 2017 07:46  |
Eclipse User |
|
|
|
Hello, I'm trying to refine a model from the MoDisco java MetaModel. When I launch the transformation from the ATL EMFTVM Configuration, it works fine, but I want to do this as an eclipse plug-in command.
Using MoDisco programmatically, I generate a java-model of an eclipse java project, but then when I launch the ATL transformation, either the xmi model is empty, or the previous java model hasn't changed at all.
Here's a sample of the java code:
execEnv = FACTORY.createExecEnv();
resourceSet = new ResourceSetImpl();
Metamodel inOutMetamodel = EmftvmFactory.eINSTANCE.createMetamodel();
inOutMetamodel.setResource(resourceSet.getResource(URI.createURI("platform:/plugin/org.eclipse.gmt.modisco.java/model/java.ecore"), true));
execEnv.registerMetaModel("MM", inOutMetamodel);
inOutModel = EmftvmFactory.eINSTANCE.createModel();
inOutModel.setResource(resourceSet.getResource(URI.createURI("/Model/Model_java.xmi"), true));
execEnv.registerInOutModel("IN", inOutModel);
ModuleResolver moduleResolver = new DefaultModuleResolver(transformationDir, resourceSet);
execEnv.loadModule("platform:/plugin/model2test/transformation/", "m2t");
TimingData timingData = new TimingData();
timingData.finishLoading();
execEnv.run(timingData);
timingData.finish();
inOutModel.getResource().save(Collections.emptyMap());
Here's the header of the ATL file:
-- @atlcompiler emftvm
-- @nsURI MM=http://www.eclipse.org/MoDisco/Java/0.2.incubation/java
module m2t;
create OUT : MM refining IN : MM;
During the execution, the debug mode showed that both the Metamodel and the Model has been found, but still, nothing happen.
If you could give me an advice, that would be very helpful. The whole project is attached if you need more details.
Thank you
[Updated on: Thu, 02 February 2017 14:25] by Moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04564 seconds