Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Difference between launch transformation via Eclipse Run configuration and via Java
Difference between launch transformation via Eclipse Run configuration and via Java [message #1769834] Thu, 03 August 2017 22:54 Go to next message
Tracia W is currently offline Tracia WFriend
Messages: 2
Registered: August 2017
Junior Member
I wrote a ATL transformation, from model comforming to a metamodel based on ECore, to ECore models. It has some imperative blocks to do some on-the-fly generation. The transformation works fine when I run within Eclipse via "Run-Run Configuration-ATL transformation .." . I exported the launch file and it looks as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.atl.adt.launching.atlTransformation">
<stringAttribute key="ATL File Name" value="/EnviGen2Config/Gen2Config.atl"/>
<stringAttribute key="ATL VM" value="EMF-specific VM"/>
<stringAttribute key="ATL_COMPILER" value="atl2006"/>
<booleanAttribute key="IS_REFINING" value="false"/>
<mapAttribute key="Input">
<mapEntry key="IN" value="EGSample"/>
</mapAttribute>
<mapAttribute key="Libs"/>
<mapAttribute key="Model Handler">
<mapEntry key="ECORE" value="EMF"/>
<mapEntry key="EGSample" value="EMF"/>
</mapAttribute>
<mapAttribute key="ModelType">
<mapEntry key="ECORE" value="METAMODELOUTPUT"/>
<mapEntry key="EGSample" value="METAMODELINPUT"/>
<mapEntry key="IN" value="MODELINPUT"/>
<mapEntry key="OUT" value="MODELOUTPUT"/>
</mapAttribute>
<mapAttribute key="Options">
<mapEntry key="OPTION_CLEAR" value="false"/>
<mapEntry key="OPTION_CONTENT_TYPE" value="false"/>
<mapEntry key="OPTION_DERIVED" value="true"/>
<mapEntry key="allowInterModelReferences" value="true"/>
<mapEntry key="printExecutionTime" value="false"/>
<mapEntry key="step" value="false"/>
<mapEntry key="supportUML2Stereotypes" value="false"/>
</mapAttribute>
<listAttribute key="OrderedInput">
<listEntry value="IN"/>
</listAttribute>
<listAttribute key="OrderedOutput">
<listEntry value="OUT"/>
</listAttribute>
<mapAttribute key="Output">
<mapEntry key="OUT" value="ECORE"/>
</mapAttribute>
<mapAttribute key="Path">
<mapEntry key="ECORE" value="#EMF"/>
<mapEntry key="EGSample" value="/EnviGen2Config/EnviGenSample.ecore"/>
<mapEntry key="IN" value="/EnviGen2Config/Environment.xmi"/>
<mapEntry key="OUT" value="/EnviGen2Config/Environment.ecore"/>
</mapAttribute>
<stringAttribute key="Port" value="6060"/>
<listAttribute key="Superimpose"/>
</launchConfiguration>


But when I create the ATL plug-in and launch the same transformation. It always give me the following error. The messages are from ECore implementation. I guess it is because some imperative generation. However, when launcher via Eclipse run configuration works, shouldn't it also work via Java ?? Or does these two have different implementation of launchers behind??? Or what values do I still need to set in the Java code??? I did not change any code of the generated ATL plug-in except writing a main method to pass the input output file to it and set the " allowInterModelReferences" to true (same as my eclipse run configuration)


Please help. Thanks so much in advance.


Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()
Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEAttributes()

Re: Difference between launch transformation via Eclipse Run configuration and via Java [message #1770168 is a reply to message #1769834] Tue, 08 August 2017 19:30 Go to previous message
Tracia W is currently offline Tracia WFriend
Messages: 2
Registered: August 2017
Junior Member
Hi, in fact I found the generation runs successfully. Just something prevent Eclipse from refreshing the Project Explorer... But I have struggled to pass a textual syntax file (by EMFText). I modified the generated plugin code something like:

Gen2Config runner = new Gen2Config();
ResourceSet rs = new ResourceSetImpl();
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("myLanguageExtention", new MyLanguageResourceFactory());
runner.loadModels("data/input.myLanguageExtention");
runner.doGen2Config(new NullProgressMonitor());
runner.saveModels("data/output.ecore");

Print my input language resource and my input metamodel both gives a list of object same as the file content. But the output.eocre are always empty. No clue at all and tried to search online and checked the ATL lib code for 2 days. Please help. It would be wonderful if there is any sample code that I can get an impression.

[Updated on: Wed, 09 August 2017 20:40]

Report message to a moderator

Previous Topic:[solved] xmi:id and xmi:type tags in SysML
Next Topic:Plugin ATL
Goto Forum:
  


Current Time: Fri Nov 24 20:39:52 GMT 2017

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

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