Victor Guana has announced the release of ATLauncher an eclipse project with a simple standalone Java class, that can be reused to run ATL (EMFTVM) model-to-model transformations programmatically.
This has been always possible but as he says it was not documented so for non-ATL experts it was very difficult to make it happen so as part of his vision (shared by myself and many others in the modeling community as key point for a wider adoption of MDE techniques) to facilitate the integration of MDE tools in general Software Engineering toolboxes, he “has carefully picked the right dependency libraries required to use the ATL engine outside of its eclipse-plugin capsule. The ATLauncher can be seamlessly integrated with any Java solution, it can be used in mobile applications, and even made into a web service that execute small transformation scripts.”. If you like the idea, feel free to contribute/fork the ATLauncher project on GitHub.
In case you wonder, this is not the only tool with a similar goa. The ATL EMFTVM Standalone engine is another utility to run ATL transformations (using the EMFTVM VM) outside of the Eclipse environment. It’s been mainly designed to be executed from command line easing the execution of ATL transformations in shell/ant scripts, but nothing hinders you from reusing it to embed ATL into your own application. All the required dependencies are already bundled, providing a ready-to-use tool.
We provide a self-contained fat JAR that can be directly downloaded from here
The standalone engine is used as follows:
$ java -jar atl-emftvm-fatjar.jar
Missing required options: f, s, t, i
usage: java -jar -f -s
-t -i
[-o ] [-q]
-f,--file ATL transformation file
-s,--source-metamodel Source metamodel file
-t,--target-metamodel Target metamodel file
-i,--input Input file
-o,--output Output file (optional)
-q,--quiet Do not print any information
about the transformation
execution on the standard output
(optional, defaults to false)
$ java -jar atl-emftvm-fatjar.jar -f Class2Relational.emftvm -s Class.ecore -t
Relational.ecore -i input.xmi
Timing data:
Loading finished at 1,108435 seconds (duration: 1,108435 seconds)
Matching finished at 1,138189 seconds (duration: 0,029753 seconds)
Applying finished at 1,149688 seconds (duration: 0,011499 seconds)
Post-applying finished at 1,149742 seconds (duration: 0,000054 seconds)
Recursive stage finished at 1,149776 seconds (duration: 0,000034 seconds)
Execution finished at 1,149847 seconds (duration: 0,000105 seconds)
Unleash the power of ATL!
ICREA Research Professor at Internet Interdisciplinary Institute (UOC). Leader of the SOM Research Lab focusing on the broad area of systems and software engineering. Home page.
Hello, thank you for sharing this one!
Hi, thank for sharing. I have problem. How are you do to generate with multiple packages in metamodels file? There are multiple URIs. We need ExecEnvPool ?
The method lazyMetamodelRegistration. I return Set of URIs. But after I’m Blocked. Thank
Hi Jérémy, you may want to get in touch with Victor directly and see if he can help you
Okay. I’ll ask him on his blog. Thank you. Thank you.
Is there a way to run an ATL programmatically (outside the ECLIPSE environment) with no OUTPUT models because the ATL-code runs an ATL-query. The output is code or a script. Like some of the examples in the ATL zoo (the Example: Microsoft Office Excel Extractor code starts with query XML2Text = XML!Root.allInstances()
->asSequence()
->first().ExcelFile().writeTo(‘C:\\ … path to be completed before using the
transformation … \\exampleExcelJavaSo
Not sure this is possible. I think you always need the output model. Then you can export/transform this model into a text
Well, that is the point. Transforming a model into text with ATL is an ATL-query, so the question remains “how do you export/transform the model into text (with ATL and programmatically)