Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:41 Go to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
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 14:53 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
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 16:30 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
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 16:11 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
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: Thu Apr 25 23:47:08 GMT 2024

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

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

Back to the top