Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL to ATL Refining Mode
ATL to ATL Refining Mode [message #985902] Fri, 16 November 2012 15:54 Go to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
I'm trying to refine my ATL transformation using ATL. The end goal is to dynamically build my input model list. However, i'm having lots of problems getting up and running.

I am running Eclipse Juno and ATL 3.2.1. The issues are as follows:
1) The ATL Metamodel is registered in the EMF Registry. Why is this? I can see the ecore model in the jar org.eclipse.m2m.atl.dsls_3.3.0.v201205241358
2) I have imported the ATL.ecore into my workspace due to the issue in #1. It does not validate. I see 3 errors.
3) When running a simple ATL refiner I get the following error, i assume it is because of #2, "Error loading platform:/resource/TestRefining/Public2Private.atl: org.xml.sax.SAXParseException: Content is not allowed in prolog."

The refiner is as follows:

-- @atlcompiler atl2010
-- @nsURI ATL=http://www.eclipse.org/gmt/2005/ATL
--http://www.eclipse.org/m2m/atl/2011/EMFTVM
--http://www.eclipse.org/gmt/2005/ATL

module AtlFlattenerRefine;
--create OUT : ATL refining IN : ATL;
create OUT : ATL from IN : ATL;

rule RebuildCreateList{
from s : ATL!Rule
to t : ATL!Rule(
name <-s. name+'ZZZZZZZZZ'.debug('q')
)
}

I also did some testing with ATL 3.3.1 but got nowhere there either. That said the ATL.ecore was available via the uri http://www.eclipse.org/m2m/atl/2011/EMFTVM. Any help is appreciated!

Thanks,
Ronan
Re: ATL to ATL Refining Mode [message #985904 is a reply to message #985902] Fri, 16 November 2012 15:57 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You have to inject the transformation in xmi first and you'll have to extract it in text after the transformation also.
Re: ATL to ATL Refining Mode [message #985905 is a reply to message #985904] Fri, 16 November 2012 16:00 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Oh Sad

I think I remember doing something like that with AMW years ago. Have you got an example that works with the latest versions of ATL?

Thanks!
Ronan
Re: ATL to ATL Refining Mode [message #985911 is a reply to message #985905] Fri, 16 November 2012 16:12 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Perhaps this post is similar? http://www.eclipse.org/forums/index.php/t/32412/ Any code examples available?

I also some really useful stuff at http://www.eclipse.org/forums/index.php/t/367267/

I got step one working where I generate the .xmi file using ATLCopy and emftvm compiler.

Step two failed with an error "org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/gmt/2005/ATL' not found. (platform:/resource/TestRefining/Public2Private.xmi, 3, 75)". I am using the ATL MM URI http://www.eclipse.org/gmt/2005/ATL. This is stuck into the XMI by ATLCopy. I assume when it tries to load the model it fails as this URI isn't actually registered by ATL. I see I can register the model manually, why doesn't the ATL plugin do this? Once registered I the Refine step works.

Now how do I get the ATL text back from the XMI?

Thanks,
Ronan

[Updated on: Fri, 16 November 2012 17:13]

Report message to a moderator

Re: ATL to ATL Refining Mode [message #985921 is a reply to message #985911] Fri, 16 November 2012 16:52 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello,

You can use a small ANT script with calls to ATL ANT Tasks to inject your ATL file (.atl) as an ATL model (.xmi), and after transformation to extract your ATL model as an ATL file.
You have to use the atl.loadModel and atl.saveModel tasks with the right injection/extraction parameter as explained in the documentation.

I hope this helps.

Hugo


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: ATL to ATL Refining Mode [message #985925 is a reply to message #985921] Fri, 16 November 2012 17:15 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Ok great! I will try.
Thanks Hugo!
Re: ATL to ATL Refining Mode [message #986013 is a reply to message #985902] Sat, 17 November 2012 13:42 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

EMFTVM can load .atl files as models directly, but does not yet support
refining mode. You may use ATLCopy.atl and module superimposition:

http://git.eclipse.org/c/mmt/org.eclipse.atl.git/tree/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLCopy.atl

Your code should look something like this:

-- @atlcompiler emftvm
-- @nsURI ATL=http://www.eclipse.org/gmt/2005/ATL
module AtlFlattenerRefine;
create OUT : ATL from IN : ATL;
uses ATLCopy;

-- Redefine "MatchedRule" rule from ATLCopy
rule MatchedRule {
from s : ATL!MatchedRule
to t : ATL!MatchedRule(
name <-s. name+'ZZZZZZZZZ'.debug('q')
)
}

Cheers,
Dennis

Op 16/11/12 16:54, Ronan B schreef:
> Hi,
> I'm trying to refine my ATL transformation using ATL. The end goal is to
> dynamically build my input model list. However, i'm having lots of problems
> getting up and running.
>
> I am running Eclipse Juno and ATL 3.2.1. The issues are as follows:
> 1) The ATL Metamodel is registered in the EMF Registry. Why is this? I can see
> the ecore model in the jar org.eclipse.m2m.atl.dsls_3.3.0.v201205241358
> 2) I have imported the ATL.ecore into my workspace due to the issue in #1. It
> does not validate. I see 3 errors.
> 3) When running a simple ATL refiner I get the following error, i assume it is
> because of #2, "Error loading
> platform:/resource/TestRefining/Public2Private.atl:
> org.xml.sax.SAXParseException: Content is not allowed in prolog."
>
> The refiner is as follows:
>
> -- @atlcompiler atl2010
> -- @nsURI ATL=http://www.eclipse.org/gmt/2005/ATL
> --http://www.eclipse.org/m2m/atl/2011/EMFTVM
> --http://www.eclipse.org/gmt/2005/ATL
>
> module AtlFlattenerRefine;
> --create OUT : ATL refining IN : ATL;
> create OUT : ATL from IN : ATL;
>
> rule RebuildCreateList{
> from s : ATL!Rule
> to t : ATL!Rule(
> name <-s. name+'ZZZZZZZZZ'.debug('q')
> )
> }
>
> I also did some testing with ATL 3.3.1 but got nowhere there either. That said
> the ATL.ecore was available via the uri
> http://www.eclipse.org/m2m/atl/2011/EMFTVM. Any help is appreciated!
>
> Thanks,
> Ronan


Cheers,
Dennis
Re: ATL to ATL Refining Mode [message #986210 is a reply to message #986013] Mon, 19 November 2012 13:29 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi Dennis,
Okay I have tried to create this in an ANT script but I just get the following out:

<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>

My ANT file looks like this:

<project name="MyProject" default="x" basedir=".">
<description>
x
</description>
<target name="x" description="x" >
<emftvm.loadMetamodel name="ATL" uri="http://www.eclipse.org/gmt/2005/ATL"/>
<emftvm.loadModel name="Public2Private" wspath="TestRefining/Public2Private.atl"/>
<emftvm.run modulepath="platform:/resource/TestRefining/" module="ATLFlattenerRefine">
<metamodel name="ATL"/>
<inputmodel name="Public2Private" as="IN"/>
<outputmodel name="ATLCopy-OUT" as="OUT" wspath="TestRefining/ZZZZ.xmi"/>
</emftvm.run>
<emftvm.saveModel name="ATLCopy-OUT" derived="true"/>
</target>
</project>

When I run via the regular run configuration I get a full XMI file.

One other thing. It is cool the injection is automatic but how about serialization back to ATL for the output model with ANT.

Thanks!
Ronan
Re: ATL to ATL Refining Mode [message #986432 is a reply to message #986013] Tue, 20 November 2012 12:15 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
Messages: 35
Registered: June 2011
Member
Hi Dennis,

do you have some documentation about the API of EMFTVM that helps to load an atl file? Is there an ATL unparser as well? (by unparser I mean an implementation of an XMI to ATL code)

Thanks a lot for your help,
Etienne.
Re: ATL to ATL Refining Mode [message #986438 is a reply to message #986210] Tue, 20 November 2012 12:20 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
A quick update. I got what I wanted working using the 2006 compiler. I'll update this post later when I figure out the deserialization/extraction using the newest compiler. For anyone who is interested the ANT for the 2006 compiler is as follows:

<project name="MyProject2006" default="x" basedir=".">
<description>
x
</description>
<target name="x" description="x" >
<atl.loadModel name="ATL" metamodel="MOF" uri="http://www.eclipse.org/gmt/2005/ATL"/>
<atl.loadModel name="UML" metamodel="MOF" uri="http://www.eclipse.org/uml2/2.1.0/UML"/>
<atl.loadModel name="myATL" metamodel="ATL" path="Public2Private.atl">
<injector name="ATL" />
</atl.loadModel>
<atl.loadModel name="myUML" metamodel="UML" path="My.uml"/>
<atl.launch path="ATLRefine.asm">
<option name="allowInterModelReferences" value="true"/>
<inmodel name="IN" model="myATL"/>
<inmodel name="IN2" model="myUML"/>
<superimpose path="ATLCopy.atl"/>
<outmodel name="OUT" model="myOut" metamodel="ATL"/>
</atl.launch>
<atl.saveModel model="myOut" path="SavingMySample.atl">
<extractor name="ATL"/>
</atl.saveModel>
</target>
</project>

Now to get this working with just the API and not ANT Smile

Regards,
Ronan

[Updated on: Tue, 20 November 2012 12:20]

Report message to a moderator

Re: ATL to ATL Refining Mode [message #986539 is a reply to message #986210] Tue, 20 November 2012 20:27 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Op 19/11/12 14:29, Ronan B schreef:
> Hi Dennis,
> Okay I have tried to create this in an ANT script but I just get the following
> out:
>
> <?xml version="1.0" encoding="ASCII"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
>
> My ANT file looks like this:
>
> <project name="MyProject" default="x" basedir=".">
> <description>
> x
> </description>
> <target name="x" description="x" >
> <emftvm.loadMetamodel name="ATL"
> uri="http://www.eclipse.org/gmt/2005/ATL"/>
> <emftvm.loadModel name="Public2Private"
> wspath="TestRefining/Public2Private.atl"/>
> <emftvm.run modulepath="platform:/resource/TestRefining/"
> module="ATLFlattenerRefine">
> <metamodel name="ATL"/>
> <inputmodel name="Public2Private" as="IN"/>
> <outputmodel name="ATLCopy-OUT" as="OUT"
> wspath="TestRefining/ZZZZ.xmi"/>
> </emftvm.run>
> <emftvm.saveModel name="ATLCopy-OUT" derived="true"/>
> </target>
> </project>
>
> When I run via the regular run configuration I get a full XMI file.

You should first load the .atl model, and then the ATL metamodel, because the
ATL parser insists on loading its own version of the ATL metamodel. EMFTVM
will reuse the ATL metamodel that was pre-loaded by the ATL parser.

Sounds counter-intuitive, but that's the conceptual mismatch between ATL and
EMF: EMF automatically determines the required metamodel from the model
itself, but ATL needs an explicit reference (to deal with output models,
a.o.). The Eclipse launch dialog takes care of this behind the scenes, but in
Ant, you prescribe the loading order.

>
> One other thing. It is cool the injection is automatic but how about
> serialization back to ATL for the output model with ANT.
>
> Thanks!
> Ronan

EMF selects the resource implementation (XMI, XML, ATL ,...) based on file
extension. That's why you need to save your UML models using the .uml
extension, or the wrong resource implementation is used.

If you want EMF to select the ATL resource implementation for the output
model, you should use the .atl file extension. Then you will get a textual ATL
file.

Cheers,
Dennis


Cheers,
Dennis
Re: ATL to ATL Refining Mode [message #986541 is a reply to message #986432] Tue, 20 November 2012 20:40 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Op 20/11/12 13:15, EtienneB Mising name schreef:
> Hi Dennis,
>
> do you have some documentation about the API of EMFTVM that helps to load an

Unfortunately no documentation. There are only examples for now:

Test for EMFTVM ant tasks:
http://git.eclipse.org/c/mmt/org.eclipse.atl.git/tree/tests/org.eclipse.m2m.atl.emftvm.tests/anttest/build.xml

Compiler-copy script - copies the ATLtoEMFTVM.atl compiler to an XMI version
of itself:
http://git.eclipse.org/c/mmt/org.eclipse.atl.git/tree/plugins/org.eclipse.m2m.atl.emftvm.compiler/compiler-copy/build.xml

And for the meta-lovers:

Compiler-compiler script - compiles the ATLtoEMFTVM.atl compiler using an
older version of itself:
http://git.eclipse.org/c/mmt/org.eclipse.atl.git/tree/plugins/org.eclipse.m2m.atl.emftvm.compiler/compiler-compiler/build.xml

Compiled-compiler-compiler script - compiles the ATLtoEMFTVM.atl compiler
using the compiled version of itself:
http://git.eclipse.org/c/mmt/org.eclipse.atl.git/tree/plugins/org.eclipse.m2m.atl.emftvm.compiler/compiler-compiler/compiled-compiler-compiler/build.xml

> atl file? Is there an ATL unparser as well? (by unparser I mean an
> implementation of an XMI to ATL code)
>
> Thanks a lot for your help,
> Etienne.

EMFTVM provides a complete EMF resource implementation for ATL, which includes
both injector (parser) and extractor (pretty-printer). As EMF selects the
resource implementation based on file name extension, you should always use
..atl for input as well as output models to trigger the use of the ATL parser
and pretty-printer.

Cheers,
Dennis


Cheers,
Dennis
Re: ATL to ATL Refining Mode [message #986937 is a reply to message #986539] Thu, 22 November 2012 12:30 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi Dennis,
Okay great, I would never of guessed the order made a difference there. Is there anyway of improving the error handling to help future users with this issue?

Now my test injector/extractor/refiner works beautifully Smile ANT code is as follows:

<project name="MyProject" default="x" basedir=".">
<description>
x
</description>
<target name="x" description="x" >
<emftvm.loadModel name="Public2Private" wspath="TestRefining/Public2Private.atl"/>
<emftvm.loadMetamodel name="ATL" uri="http://www.eclipse.org/gmt/2005/ATL"/>
<emftvm.run modulepath="platform:/resource/TestRefining/" module="ATLCopy">
<metamodel name="ATL"/>
<inputmodel name="Public2Private" as="IN"/>
<outputmodel name="ATLCopy-OUT" as="OUT" wspath="TestRefining/out/Public2Private.atl"/>
</emftvm.run>
<emftvm.saveModel name="ATLCopy-OUT" derived="true"/>
</target>
</project>

Now i'm going to try getting this to work via the API. I'm sure i'll have more questions, but hopefully we can get something together here on the Forum as a lot of people seem to be interested in the new VM.

Thanks again!
Ronan
Re: ATL to ATL Refining Mode [message #987303 is a reply to message #986937] Sun, 25 November 2012 21:13 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Op 22-11-12 13:30, Ronan B schreef:
> Hi Dennis,
> Okay great, I would never of guessed the order made a difference there. Is
> there anyway of improving the error handling to help future users with this
> issue?

Probably yes. I'll look into it.

Dennis

>
> Now my test injector/extractor/refiner works beautifully :) ANT code is as
> follows:
>
> <project name="MyProject" default="x" basedir=".">
> <description>
> x
> </description>
> <target name="x" description="x" >
> <emftvm.loadModel name="Public2Private"
> wspath="TestRefining/Public2Private.atl"/>
> <emftvm.loadMetamodel name="ATL"
> uri="http://www.eclipse.org/gmt/2005/ATL"/>
> <emftvm.run modulepath="platform:/resource/TestRefining/"
> module="ATLCopy">
> <metamodel name="ATL"/>
> <inputmodel name="Public2Private" as="IN"/>
> <outputmodel name="ATLCopy-OUT" as="OUT"
> wspath="TestRefining/out/Public2Private.atl"/>
> </emftvm.run>
> <emftvm.saveModel name="ATLCopy-OUT" derived="true"/>
> </target>
> </project>
>
> Now i'm going to try getting this to work via the API. I'm sure i'll have more
> questions, but hopefully we can get something together here on the Forum as a
> lot of people seem to be interested in the new VM.
>
> Thanks again!
> Ronan


Cheers,
Dennis
Re: ATL to ATL Refining Mode [message #987405 is a reply to message #986432] Mon, 26 November 2012 13:48 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi Etienne,
I finally got the emftvm to run via the API. Unfortuantely the API is not the same as the one provided before in CoreService. Perhaps it can be in the future? I figured this out by debugging a laucnher that works. You will need a copy of many of the methods in org.eclipse.m2m.atl.emftvm.launcher/EMFTVMLaunchConfigurationDelegate to make this work. They are private there. The values are hardcoded below but are easily made generic.

ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
ResourceSet rs = new ResourceSetImpl();


Map<String, String> metamodelLocations = new HashMap<String, String>();
metamodelLocations.put("ATL","http://www.eclipse.org/gmt/2005/ATL");
Map<String, String> metamodelOptions = new HashMap<String, String>();
loadFileMetaModels(rs, metamodelLocations, metamodelOptions, env);

Map<String, String> inputModelLocations = new HashMap<String, String>();
inputModelLocations.put("IN", "platform:/resource/TestRefining/Public2Private.atl");
Map<String, String> inputModelOptions = new HashMap<String, String>();
loadInputModels(rs, inputModelLocations, inputModelOptions, env);

Map<String, String> outputModelLocations = new HashMap<String, String>();
outputModelLocations.put("OUT","platform:/resource/TestRefining/Public2Private_refined.atl");
Map<String, String> outputModelOptions = new HashMap<String, String>();
outputModelOptions.put("OUT","allowIntermodelReferences derivedFile");
createOutputModels(rs, outputModelLocations, outputModelOptions, env);

loadOtherMetaModels(rs, metamodelLocations, metamodelOptions, env);

ModuleResolver resolver = createModuleResolver("/TestRefining/");
env.loadModule(resolver, "ATLCopy");

TimingData timingData = new TimingData();
env.run(timingData);
Map<String, String> emptyMap = Collections.emptyMap();
saveModels(env.getOutputModels(), outputModelOptions, emptyMap);

After getting all this to work in Juno I found out the emftvm compiler does not work in Eclipse Helios Version: 3.6.2.r362_v20101104-9SAxFMKFkSAqi8axkv1ZjegmiBLY
Build id: M20110210-1200. I get the following error:

Errors occurred during the build.
Errors running builder 'ATL builder' on project 'X'.
org.eclipse.emf.ecore.util.Switch

Should I file a bug Dennis?

Regards,
Ronan



Re: ATL to ATL Refining Mode [message #987500 is a reply to message #987405] Mon, 26 November 2012 21:23 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Hello Ronan, Etienne,

Op 26/11/12 14:48, Ronan B schreef:
> Hi Etienne,
> I finally got the emftvm to run via the API. Unfortuantely the API is not the
> same as the one provided before in CoreService. Perhaps it can be in the
> future? I figured this out by debugging a laucnher that works. You will need a
> copy of many of the methods in
> org.eclipse.m2m.atl.emftvm.launcher/EMFTVMLaunchConfigurationDelegate to make
> this work. They are private there. The values are hardcoded below but are
> easily made generic.
>
> ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
> ResourceSet rs = new ResourceSetImpl();

Basically, ExecEnv *is* the API. EMFTVM does not align with ATL's ILauncher
and IModel interfaces due to explicit design choice:

1. ATL/EMFTVM should not provide API for model loading/saving: this is the
domain of EMF. Any questions regarding loading/saving/parsing/pretty-printing
should be forwardable to EMF/EMFText/xText(/TCS?) whenever possible.
ATL/EMFTVM should stick to transformation.

2. ATL/EMFTVM should not record model-metamodel relationships when it cannot
enforce them anyway; EMF has a different, incompatible way of representing
model-metamodel relationships (i.e. on a per-instance basis, using XML
namespaces for example).

>
>
> Map<String, String> metamodelLocations = new HashMap<String, String>();
> metamodelLocations.put("ATL","http://www.eclipse.org/gmt/2005/ATL");
> Map<String, String> metamodelOptions = new HashMap<String, String>();
> loadFileMetaModels(rs, metamodelLocations, metamodelOptions, env);
>
> Map<String, String> inputModelLocations = new HashMap<String, String>();
> inputModelLocations.put("IN",
> "platform:/resource/TestRefining/Public2Private.atl");
> Map<String, String> inputModelOptions = new HashMap<String, String>();
> loadInputModels(rs, inputModelLocations, inputModelOptions, env);
>
> Map<String, String> outputModelLocations = new HashMap<String, String>();
> outputModelLocations.put("OUT","platform:/resource/TestRefining/Public2Private_refined.atl");
>
> Map<String, String> outputModelOptions = new HashMap<String, String>();
> outputModelOptions.put("OUT","allowIntermodelReferences derivedFile");
> createOutputModels(rs, outputModelLocations, outputModelOptions, env);
>
> loadOtherMetaModels(rs, metamodelLocations, metamodelOptions, env);
>
> ModuleResolver resolver = createModuleResolver("/TestRefining/");
> env.loadModule(resolver, "ATLCopy");
>
> TimingData timingData = new TimingData();
> env.run(timingData);
> Map<String, String> emptyMap = Collections.emptyMap();
> saveModels(env.getOutputModels(), outputModelOptions, emptyMap);

The above code translates an Eclipse launch configuration to the EMFTVM
ExecEnv API. Another example of using EMFTVM as part of an Eclipse plug-in can
be found here (see lines 200-225):

http://soft.vub.ac.be/viewvc/UML2CaseStudies/uml2cs-instantmessenger-config-editor/src/be/ac/vub/uml2cs/instantmessenger/popup/actions/GenerateBuildFileAction.java?view=markup

The basic recipe is quite simple:

1. Wrap any loaded EMF models inside EMFTVM Model and Metamodel instances:

Metamodel xml = EmftvmFactory.eINSTANCE.createMetamodel();
xml.setResource(emfResource);

Model in = EmftvmFactory.eINSTANCE.createModel();
in.setResource(anotherEmfResource);

1. Create an ExecEnv instance:

ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();

2. Register any input/output/inout/meta-models:

env.registerMetaModel("CFG", cfg);
env.registerMetaModel("XML", xml);
env.registerInputModel("IN", in);
env.registerOutputModel("OUT", pars);

3. Create a module resolver that can load .emftvm modules and their imports
(DefaultModuleResolver expects a trailing '/' in the prefix!):

ModuleResolver resolver = new
DefaultModuleResolver("platform:/resource/.../", resourceSet);

4. Load a named module using the module resolver:

env.loadModule(resolver, "Module");

-- or, for modules that are contained in a package (folder):

env.loadModule(resolver, "Package::Module");

5. Run the transformation:

env.run(null);

You may add a TimingData object to the mix as well, if you're interested in
performance statistics.

>
> After getting all this to work in Juno I found out the emftvm compiler does
> not work in Eclipse Helios Version:
> 3.6.2.r362_v20101104-9SAxFMKFkSAqi8axkv1ZjegmiBLY
> Build id: M20110210-1200. I get the following error:
>
> Errors occurred during the build.
> Errors running builder 'ATL builder' on project 'X'.
> org.eclipse.emf.ecore.util.Switch
>
> Should I file a bug Dennis?

Hmm, you may. Try to include a stack trace as well. I suspect that I'm using a
newer version EMF... I've only tried EMFTVM on Eclipse 3.7 and up.

Cheers,
Dennis

>
> Regards,
> Ronan
>
>
>
>


Cheers,
Dennis
Re: ATL to ATL Refining Mode [message #989464 is a reply to message #987500] Thu, 06 December 2012 10:24 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Thanks for the details. I'll work some more with this later. For now I can't as I have a dependency on Eclipse 3.6. I've added a bugzilla item as previously discussed. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=395906
Thanks,
Ronan
Previous Topic:Errors when removing from and adding to the same sequence in refining mode
Next Topic:Stack size limitation in EMF-specific VM
Goto Forum:
  


Current Time: Fri Mar 29 05:39:09 GMT 2024

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

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

Back to the top