Extract ATL transformation (.atl) from ATL Model (.xmi) with Java [message #1106819] |
Wed, 11 September 2013 11:41  |
Eclipse User |
|
|
|
After using ANT task to extract atl transformation (.atl) from an ATL model (.xmi),
<?xml version="1.0"?>
<project name="atlcopy" default="run" basedir=".">
<property name="out1" value="transformation.xmi"/>
<property name="atl.launcher" value="EMF-specific VM" />
<target name="run">
<atl.loadModel modelHandler="EMF" name="ATL" metamodel="MOF" path="../MetaModels/ATL.ecore" />
<atl.loadModel name="atl1" metamodel="ATL" path="${out1}"/>
<atl.saveModel model="atl1" path="${out1}.out.atl">
<extractor name="ATL"/>
</atl.saveModel>
</target>
</project>
I try now to use java to do it.
However I dont find a concrete example to use it!
DO you have any idea, please?
Best regards
|
|
|
|
|
Re: Extract ATL transformation (.atl) from ATL Model (.xmi) with Java [message #1150200 is a reply to message #1148611] |
Tue, 22 October 2013 12:11  |
Eclipse User |
|
|
|
Hi,
You can use the LauncherService.launch method as below:
LauncherService.launch(ILauncher.RUN_MODE,
monitor,
launcher,
modelFactories,
extractors,
injectors,
inModels,
inoutModels,
outModels,
modelPaths,
options,
libraries,
modules);
}
The extractor should be like this:
extractors.put("OUT",CoreService.getExtractor("ATL"));
You must have an output model of type "ATL", like this:
outModels.put("OUT", "ATL");
If you have the injector working already then you just need to plug these settings in to get the output model as an ATL file.
Regards,
Ronan
|
|
|
Powered by
FUDForum. Page generated in 0.04892 seconds