Skip to main content



      Home
Home » Modeling » ATL » Extract ATL transformation (.atl) from ATL Model (.xmi) with Java
Extract ATL transformation (.atl) from ATL Model (.xmi) with Java [message #1106819] Wed, 11 September 2013 11:41 Go to next message
Eclipse UserFriend
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 #1130431 is a reply to message #1106819] Wed, 09 October 2013 10:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
Take a look at http://www.eclipse.org/forums/index.php/t/440387/ also consider using the patch I wrote in the bugzilla if you hit the same bug.
Regards,
Ronan
Re: Extract ATL transformation (.atl) from ATL Model (.xmi) with Java [message #1148611 is a reply to message #1130431] Mon, 21 October 2013 12:30 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ronan!
Sorry for the delay!
Thank you for reply!
I see your code but It is the injector code!
Can you please share (if you have) the extractor code,
because my problem Is how to go from the XMI model to the .atl file?

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 Go to previous message
Eclipse UserFriend
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
Previous Topic:ANT Task
Next Topic:ATL Plug-in dont run
Goto Forum:
  


Current Time: Wed Jul 23 15:11:17 EDT 2025

Powered by FUDForum. Page generated in 0.04892 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top