Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] (3.0) New JAVA ATL3.0 launch procedure?!
[ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99050] Fri, 06 February 2009 09:53 Go to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
Hi,
Does anybody know how to launch an ATL transformation with the new ATL3.0
libraries. I had a JAVA code that worked well, and i want to update it to
this new ATL3.0 version.
What seems not to work anymore is all the ATLEMFModelHandler operations
(save, load, getMof..).
Anybody knows about these modifications?!
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99068 is a reply to message #99050] Fri, 06 February 2009 10:30 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Answers below:

Skander a écrit :
> Hi, Does anybody know how to launch an ATL transformation with the new
> ATL3.0 libraries. I had a JAVA code that worked well, and i want to
> update it to this new ATL3.0 version.
> What seems not to work anymore is all the ATLEMFModelHandler operations
> (save, load, getMof..).

In the RegularVM (old virtual machine) context, those operations are now
located in the ASMModelLoader class (and subclasses).

> Anybody knows about these modifications?!
>

There is now an example of java launching that you can directly install
using the wizard:
new->example->atl->public2private

This example adds a popup when right-clicking on UML2 models and
launches the refining public2private transformation (privatize public
fields and generate getters/setters).

Note that the new launching interface allow to launch both EMFVM and
RegularVM, using same code. But you still can directly use the RegularVM
api if you simply want to update your java code.

Do not hesitate to ask if you encounter problems !

Best regards,

William
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99083 is a reply to message #99068] Fri, 06 February 2009 13:52 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hi !

I've downloaded with CVS last source of ATL and it's very good to
provide example for code transformation

but is it planned to provide a service for creating an equivalent of
org.eclipse.m2m.atl.examples.public2private.ui plugin depending of user
ATL file ?

or creating extension point referencing asm file and file extension able
to launch atl transformations ?

William Piers a écrit :
> Hello,
>
> Answers below:
>
> Skander a écrit :
>> Hi, Does anybody know how to launch an ATL transformation with the new
>> ATL3.0 libraries. I had a JAVA code that worked well, and i want to
>> update it to this new ATL3.0 version.
>> What seems not to work anymore is all the ATLEMFModelHandler
>> operations (save, load, getMof..).
>
> In the RegularVM (old virtual machine) context, those operations are now
> located in the ASMModelLoader class (and subclasses).
>
>> Anybody knows about these modifications?!
>>
>
> There is now an example of java launching that you can directly install
> using the wizard:
> new->example->atl->public2private
>
> This example adds a popup when right-clicking on UML2 models and
> launches the refining public2private transformation (privatize public
> fields and generate getters/setters).
>
> Note that the new launching interface allow to launch both EMFVM and
> RegularVM, using same code. But you still can directly use the RegularVM
> api if you simply want to update your java code.
>
> Do not hesitate to ask if you encounter problems !
>
> Best regards,
>
> William




Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99098 is a reply to message #99083] Fri, 06 February 2009 13:54 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
oops sorry it seems it exists is this extension :
org.eclipse.m2m.atl.service.core.transformation is able to do what i meant ?

Tristan FAURE a écrit :
> Hi !
>
> I've downloaded with CVS last source of ATL and it's very good to
> provide example for code transformation
>
> but is it planned to provide a service for creating an equivalent of
> org.eclipse.m2m.atl.examples.public2private.ui plugin depending of user
> ATL file ?
>
> or creating extension point referencing asm file and file extension able
> to launch atl transformations ?
>
> William Piers a écrit :
>> Hello,
>>
>> Answers below:
>>
>> Skander a écrit :
>>> Hi, Does anybody know how to launch an ATL transformation with the
>>> new ATL3.0 libraries. I had a JAVA code that worked well, and i want
>>> to update it to this new ATL3.0 version.
>>> What seems not to work anymore is all the ATLEMFModelHandler
>>> operations (save, load, getMof..).
>>
>> In the RegularVM (old virtual machine) context, those operations are
>> now located in the ASMModelLoader class (and subclasses).
>>
>>> Anybody knows about these modifications?!
>>>
>>
>> There is now an example of java launching that you can directly
>> install using the wizard:
>> new->example->atl->public2private
>>
>> This example adds a popup when right-clicking on UML2 models and
>> launches the refining public2private transformation (privatize public
>> fields and generate getters/setters).
>>
>> Note that the new launching interface allow to launch both EMFVM and
>> RegularVM, using same code. But you still can directly use the
>> RegularVM api if you simply want to update your java code.
>>
>> Do not hesitate to ask if you encounter problems !
>>
>> Best regards,
>>
>> William




Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99112 is a reply to message #99098] Fri, 06 February 2009 15:09 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Answers below:
Tristan FAURE a écrit :
> oops sorry it seems it exists is this extension :
> org.eclipse.m2m.atl.service.core.transformation is able to do what i
> meant ?
>

No, this plugin is an old one, it is no more maintained.

> Tristan FAURE a écrit :
>> Hi !
>>
>> I've downloaded with CVS last source of ATL and it's very good to
>> provide example for code transformation
>>

Note that to ensure that you use the good plugins you can use the psf
files to download plugins.
http://wiki.eclipse.org/ATL/User_Guide#Install_ATL_from_CVS

The ATL3.0 builds also contains the examples, directly deployable using
the example wizard.
ATL 3.0.0M5 has been uploaded today, so feel free to test it!
http://www.eclipse.org/modeling/download.php?file=/modeling/ m2m/atl/downloads/drops/3.0.0/S200902051237/m2m-atl-SDK-3.0. 0M5.zip

>> but is it planned to provide a service for creating an equivalent of
>> org.eclipse.m2m.atl.examples.public2private.ui plugin depending of
>> user ATL file ?
>>

The first intent of the public2private example was to provide a concrete
and working example of a programmatical use of ATL.
Now, it's clear that this kind of example (not only refactoring) is a
common case for many users, so we certainly will have to provide this
extension.
But I can't say exactly when for the moment :-)

Best regards,

William

>> or creating extension point referencing asm file and file extension
>> able to launch atl transformations ?
>>
>> William Piers a écrit :
>>> Hello,
>>>
>>> Answers below:
>>>
>>> Skander a écrit :
>>>> Hi, Does anybody know how to launch an ATL transformation with the
>>>> new ATL3.0 libraries. I had a JAVA code that worked well, and i want
>>>> to update it to this new ATL3.0 version.
>>>> What seems not to work anymore is all the ATLEMFModelHandler
>>>> operations (save, load, getMof..).
>>>
>>> In the RegularVM (old virtual machine) context, those operations are
>>> now located in the ASMModelLoader class (and subclasses).
>>>
>>>> Anybody knows about these modifications?!
>>>>
>>>
>>> There is now an example of java launching that you can directly
>>> install using the wizard:
>>> new->example->atl->public2private
>>>
>>> This example adds a popup when right-clicking on UML2 models and
>>> launches the refining public2private transformation (privatize public
>>> fields and generate getters/setters).
>>>
>>> Note that the new launching interface allow to launch both EMFVM and
>>> RegularVM, using same code. But you still can directly use the
>>> RegularVM api if you simply want to update your java code.
>>>
>>> Do not hesitate to ask if you encounter problems !
>>>
>>> Best regards,
>>>
>>> William
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99274 is a reply to message #99112] Mon, 09 February 2009 16:11 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
hi, do you have an example where you launch a transformation with an
output model that has its own metamodel and with external helper libraries.
I tried to adapt the public2private but i still have some problems,
especially with the last parameter of the launch method:

launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor() , options,
new Object[] {asmURL.openStream()});

I do not use the same initilization as the example publi2private :

static {
// ATL public2private transformation
Bundle bundle =
Platform.getBundle("org.eclipse.m2m.atl.examples.public2private ");
asmURL = bundle.getEntry("transformation/Public2Private.asm");
..
}

because my transformation file (.asm) is described by (c:/..../trans.asm)
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99359 is a reply to message #99274] Wed, 11 February 2009 08:51 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Skander a écrit :
> hi, do you have an example where you launch a transformation with an
> output model that has its own metamodel and with external helper libraries.

Sorry, not for the moment.

> I tried to adapt the public2private but i still have some problems,
> especially with the last parameter of the launch method:
>
> launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor() , options,
> new Object[] {asmURL.openStream()});
>
> I do not use the same initilization as the example publi2private :
>
> static {
> // ATL public2private transformation
> Bundle bundle =
> Platform.getBundle("org.eclipse.m2m.atl.examples.public2private ");
> asmURL = bundle.getEntry("transformation/Public2Private.asm"); ..
> }
>
> because my transformation file (.asm) is described by (c:/..../trans.asm)
>
>
>

The first parameter is an InputStream, so you can try this way:
InputStream is = new FileInputStream(new File(c:/..../trans.asm));

//using java 1.4
launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor() ,
options, new Object[]{is};

//using java 1.5
launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor() ,
options, is);

And to include libraries:
launcher.addLibraries("LibraryName", libraryInputStream);

Best regards,

William
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99389 is a reply to message #99359] Wed, 11 February 2009 11:03 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
hello,
my question in this post is : "do i have to write the input file path in a
special way?"
i have tried this code:

try
{
ILauncher launcher = null;
launcher = CoreService.getLauncher("EMF-specific VM"); //$NON-NLS-1$
launcher.initialize(Collections.<String, Object> emptyMap());

inMetamodel = factory.newReferenceModel();
injector.inject(inMetamodel, "http://www.eclipse.org/uml2/2.1.0/UML");
IModel inModel = factory.newModel(inMetamodel);
File file = new File ("D:\\A....\\MARTE_XUPV2P.uml");
injector.inject(inModel, file.getPath());
launcher.addInOutModel(inModel, "IN", "UML2");

outputMetamodel = factory.newReferenceModel();
injector.inject(outputMetamodel, "http:///AADL/core");
IModel outModel = factory.newModel(outputMetamodel);
launcher.addOutModel(outModel, "OUT" , "AAXL");

InputStream is = new FileInputStream(new File("/Trans.asm"));
launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor() , options,
is);

extractor.extract(outModel, "/res/result.aaxl");
}
catch (Exception e)
{
e.printStackTrace();
}


///// But the injector.inject returns a file not found exception when i
give a relatif input file name, and returns a unknown protocol exception
when i give the absolute path of the file. do i have to write the file
path in a special way?
Thanks
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99433 is a reply to message #99389] Wed, 11 February 2009 14:21 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
I finally could launch a simple transformation without libraries with this
code:

try
{
ILauncher launcher = null;
launcher = CoreService.getLauncher("EMF-specific VM"); //$NON-NLS-1$
launcher.initialize(Collections.<String, Object> emptyMap());

inMetamodel = factory.newReferenceModel();
injector.inject(inMetamodel, "http://www.eclipse.org/uml2/2.1.0/UML");
IModel inModel = factory.newModel(inMetamodel);
URL url = new URL("file://d:\\AA......ple\\MARTE_XUPV2P.uml");
injector.inject(inModel, url);
launcher.addInOutModel(inModel, "IN", "UML2");

outputMetamodel = factory.newReferenceModel();
injector.inject(outputMetamodel, "http:///AADL/core");
IModel outModel = factory.newModel(outputMetamodel);
launcher.addOutModel(outModel, "OUT" , "AAXL");


InputStream is = new
FileInputStream("d:\\AA...\\OneLevelMarteToAAXL_V2.asm");
launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor() , options,
is);
//

// Saving model
URL outUrl=new URL("file://d:\\AAD....le\\result.aaxl");
extractor.extract(outModel, outUrl);
}
catch (Exception e)
{
e.printStackTrace(); }


I'll try the one with the libraries now...
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99447 is a reply to message #99389] Wed, 11 February 2009 14:38 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

To clarify the various paths notation, I wrote a small wiki section
here:
http://wiki.eclipse.org/ATL/Developer_Guide#EMFInjector_.2F_ EMFExtractor_usage

Best regards,
William

Skander a écrit :
> hello,
> my question in this post is : "do i have to write the input file path in
> a special way?"
> i have tried this code:
>
> try
> {
> ILauncher launcher = null;
> launcher = CoreService.getLauncher("EMF-specific VM"); //$NON-NLS-1$
> launcher.initialize(Collections.<String, Object> emptyMap());
>
> inMetamodel = factory.newReferenceModel();
> injector.inject(inMetamodel, "http://www.eclipse.org/uml2/2.1.0/UML");
> IModel inModel = factory.newModel(inMetamodel);
> File file = new File ("D:\\A....\\MARTE_XUPV2P.uml");
> injector.inject(inModel, file.getPath());
> launcher.addInOutModel(inModel, "IN", "UML2");
>
> outputMetamodel = factory.newReferenceModel();
> injector.inject(outputMetamodel, "http:///AADL/core");
> IModel outModel = factory.newModel(outputMetamodel);
> launcher.addOutModel(outModel, "OUT" , "AAXL");
>
> InputStream is = new FileInputStream(new File("/Trans.asm"));
> launcher.launch(ILauncher.RUN_MODE, new NullProgressMonitor() ,
> options, is);
>
> extractor.extract(outModel, "/res/result.aaxl");
> }
> catch (Exception e)
> {
> e.printStackTrace(); }
>
>
> ///// But the injector.inject returns a file not found exception when i
> give a relatif input file name, and returns a unknown protocol exception
> when i give the absolute path of the file. do i have to write the file
> path in a special way?
> Thanks
>
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99522 is a reply to message #99447] Thu, 12 February 2009 10:01 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
Hi,
did the ATL virtual machine change? because my transformation (that worked
with ATL2.0.2) do not work anymore when i launch it with the program i
posted here, the (Regular VM (with debugger)) option causes the program to
throw an exception :(java.lang.ClassCastException:
org.eclipse.m2m.atl.core.emf.EMFModel cannot be cast to
org.eclipse.m2m.atl.core.ui.vm.asm.ASMModelWrapper).

And when i use the "EMF-Specific VM" option, the transformation cannot
detect the UML packages even if it is launched:
(UML2!Package.allInstances().debug('packages') this command returns an
empty orderedSet:packages: OrderedSet {}). I tried not to use the
AllInstances method and it generated the packages correctly but it looks
like the ATL VM has changed. Is it true?
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99597 is a reply to message #99522] Thu, 12 February 2009 13:01 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Skander a écrit :
> Hi,
> did the ATL virtual machine change? because my transformation (that
> worked with ATL2.0.2) do not work anymore when i launch it with the
> program i posted here, the (Regular VM (with debugger)) option causes
> the program to throw an exception :(java.lang.ClassCastException:
> org.eclipse.m2m.atl.core.emf.EMFModel cannot be cast to
> org.eclipse.m2m.atl.core.ui.vm.asm.ASMModelWrapper).

To use the RegularVM programmatically, you have to use the Wrapper
factory: org.eclipse.m2m.atl.core.ui.vm.asm.ASMFactory.
As this api needs more information to create new models, but it is
explained in the javadoc.

You also can see an example of generic use in the LauncherService class
(org.eclipse.m2m.atl.core.service). This utility could be useful for you
if you need to switch VM choice easily.

> And when i use the "EMF-Specific VM" option, the transformation cannot
> detect the UML packages even if it is launched:
> (UML2!Package.allInstances().debug('packages') this command returns an
> empty orderedSet:packages: OrderedSet {}). I tried not to use the
> AllInstances method and it generated the packages correctly but it looks
> like the ATL VM has changed. Is it true?
>
>

The Regular VM and EMFVM are different, but - normally - have the same
behaviour (otherwise it is a bug, in one of them).
Do you have the same result when launching the transformation with a
"classic" launch configuration ?

William
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99607 is a reply to message #99597] Thu, 12 February 2009 15:17 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
you're right! when i use the launching tool from the run configurations
everything works well. Maybe because i use the regularVM when i use the
run configuration. But in my code, i'm usinf the EMF-Specific VM. I'll try
to change the code (i don't know how i will do that) to use the Regular VM.
thanks
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99614 is a reply to message #99607] Thu, 12 February 2009 16:33 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
i started using the ASMFactory, do you know how to replace this line:

factory = (EMFModelFactory)CoreService.createModelFactory("EMF");

I wrote this :
factory = (ASMFactory)CoreService.createModelFactory("????");

how can i instanciate it?
thanks
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99622 is a reply to message #99614] Thu, 12 February 2009 16:42 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
This method use the name of the factory as it is declared in its
extension point, in our case "ASM". You can find the complete extension
declaration here:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.m2m.atl/plugins/org.eclipse.m2m.atl.core.ui.vm/plug in.xml?root=Modeling_Project&view=markup

Regards,

William

Skander a écrit :
> i started using the ASMFactory, do you know how to replace this line:
>
> factory = (EMFModelFactory)CoreService.createModelFactory("EMF");
>
> I wrote this :
> factory = (ASMFactory)CoreService.createModelFactory("????");
>
> how can i instanciate it?
> thanks
>
>
EMF-specific VM for ATL 2.02 ? [message #99832 is a reply to message #99433] Thu, 12 February 2009 23:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: svent..gmail.com

Skander wrote:

> I finally could launch a simple transformation without libraries with this
> code:

> try
> {
> ILauncher launcher = null;
> launcher = CoreService.getLauncher("EMF-specific VM"); //$NON-NLS-1$


Sorry for being offtopic.

I am new to ATL and I am still using ATL 2.02. My question is whether I
can programmatically use "EMF-specific VM" instead of the Regular VM with
ATL 2.02, too ?

I am using the "ATLLauncher" Class for starting my ATL transformation
programmatically.

Regards,


Sven
[ATL] Re: EMF-specific VM for ATL 2.02 ? [message #99851 is a reply to message #99832] Fri, 13 February 2009 07:55 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hi,

In ATL 2.0.x, the launching code changes a lot depending of the used
VM... The 3.0 api provides more flexibility.
You can find informations and code about launching in atl tests (plugin
org.eclipse.m2m.atl.tests) and examples (plugin
org.eclipse.m2m.atl.examples), for both versions: on CVS HEAD for 3.0
and CVS R2_0_maintenance branch for 2.0.

Best regards,

William

Sven Trehner a écrit :
> Skander wrote:
>
>> I finally could launch a simple transformation without libraries with
>> this code:
>
>> try
>> {
>> ILauncher launcher = null;
>> launcher = CoreService.getLauncher("EMF-specific VM"); //$NON-NLS-1$
>
>
> Sorry for being offtopic.
>
> I am new to ATL and I am still using ATL 2.02. My question is whether I
> can programmatically use "EMF-specific VM" instead of the Regular VM
> with ATL 2.02, too ?
> I am using the "ATLLauncher" Class for starting my ATL transformation
> programmatically.
>
> Regards,
>
>
> Sven
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99941 is a reply to message #99622] Fri, 13 February 2009 15:03 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
hi,
i try to add an outPut model with this method:
private void addOutputModel(ILauncher launcher, String metaModelURI,
String metaModelName, String outputPath, String
modelName)
throws Exception
{
IReferenceModel outputMetamodel;
Map <String,Object> factoryOptions = new HashMap<String, Object>();
factoryOptions.put("modelHandlerName", "EMF");
factoryOptions.put("modelName", metaModelName);
factoryOptions.put("path", metaModelURI);
outputMetamodel = factory.newReferenceModel(factoryOptions);
injector.inject(outputMetamodel, metaModelURI);

factoryOptions = new HashMap<String, Object>();
factoryOptions.put("newModel", "true");
factoryOptions.put("modelName", modelName);
factoryOptions.put("path", outputPath);
outModel = factory.newModel(outputMetamodel, factoryOptions);
((RegularVMLauncher)launcher).addOutModel(outModel, modelName,
metaModelName);
}

I could add the model without any problems but i get this error message :
No type named 'AadlSpec' in metamodel '<unnamed>'

Like if the metamodel name was not correctly loaded (AADL in this case).
I have almost the same method (addInputModel) for input models but
everything works well for those.
Do you have any idea?
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #99956 is a reply to message #99941] Fri, 13 February 2009 16:22 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
The LauncherService class defines utilities method to launch a
transformation with "classic" parameters (model names, model paths, etc.).

Note that if you are working with the CVS HEAD version
(http://wiki.eclipse.org/ATL/User_Guide#Install_ATL_from_CVS), there is
a simplified launch method which directly takes the defaults factories
and injectors. This was not available in 3.0M5 build but I think it
could be useful in your case.

You can see the AtlLaunchConfigurationDelegate, or ATLNonRegression
tests to see how it works.

Best regards,

William

Skander a écrit :
> hi,
> i try to add an outPut model with this method:
> private void addOutputModel(ILauncher launcher, String metaModelURI,
> String metaModelName, String outputPath, String
> modelName)
> throws Exception {
> IReferenceModel outputMetamodel;
> Map <String,Object> factoryOptions = new HashMap<String, Object>();
> factoryOptions.put("modelHandlerName", "EMF");
> factoryOptions.put("modelName", metaModelName);
> factoryOptions.put("path", metaModelURI);
> outputMetamodel = factory.newReferenceModel(factoryOptions);
> injector.inject(outputMetamodel, metaModelURI);
>
> factoryOptions = new HashMap<String, Object>();
> factoryOptions.put("newModel", "true");
> factoryOptions.put("modelName", modelName);
> factoryOptions.put("path", outputPath);
> outModel = factory.newModel(outputMetamodel, factoryOptions);
> ((RegularVMLauncher)launcher).addOutModel(outModel, modelName,
> metaModelName);
> }
>
> I could add the model without any problems but i get this error message :
> No type named 'AadlSpec' in metamodel '<unnamed>'
>
> Like if the metamodel name was not correctly loaded (AADL in this case).
> I have almost the same method (addInputModel) for input models but
> everything works well for those.
> Do you have any idea?
>
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #100060 is a reply to message #99956] Mon, 16 February 2009 14:52 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
The latest build integrates the new launch method:
http://www.eclipse.org/modeling/download.php?file=/modeling/ m2m/atl/downloads/drops/3.0.0/I200902160913/m2m-atl-SDK-I200 902160913.zip

Best regards,

William

William Piers a écrit :
> The LauncherService class defines utilities method to launch a
> transformation with "classic" parameters (model names, model paths, etc.).
>
> Note that if you are working with the CVS HEAD version
> (http://wiki.eclipse.org/ATL/User_Guide#Install_ATL_from_CVS), there is
> a simplified launch method which directly takes the defaults factories
> and injectors. This was not available in 3.0M5 build but I think it
> could be useful in your case.
>
> You can see the AtlLaunchConfigurationDelegate, or ATLNonRegression
> tests to see how it works.
>
> Best regards,
>
> William
>
> Skander a écrit :
>> hi,
>> i try to add an outPut model with this method:
>> private void addOutputModel(ILauncher launcher, String metaModelURI,
>> String metaModelName, String outputPath, String
>> modelName)
>> throws Exception {
>> IReferenceModel outputMetamodel;
>> Map <String,Object> factoryOptions = new HashMap<String, Object>();
>> factoryOptions.put("modelHandlerName", "EMF");
>> factoryOptions.put("modelName", metaModelName);
>> factoryOptions.put("path", metaModelURI);
>> outputMetamodel = factory.newReferenceModel(factoryOptions);
>> injector.inject(outputMetamodel, metaModelURI);
>> factoryOptions = new HashMap<String, Object>();
>> factoryOptions.put("newModel", "true");
>> factoryOptions.put("modelName", modelName);
>> factoryOptions.put("path", outputPath);
>> outModel = factory.newModel(outputMetamodel, factoryOptions);
>> ((RegularVMLauncher)launcher).addOutModel(outModel, modelName,
>> metaModelName);
>> }
>>
>> I could add the model without any problems but i get this error message :
>> No type named 'AadlSpec' in metamodel '<unnamed>'
>>
>> Like if the metamodel name was not correctly loaded (AADL in this case).
>> I have almost the same method (addInputModel) for input models but
>> everything works well for those.
>> Do you have any idea?
>>
>
Re: [ATL] (3.0) New JAVA ATL3.0 launch procedure?! [message #100115 is a reply to message #99956] Tue, 17 February 2009 14:10 Go to previous message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
thanks william, everything is working well now. I took the
AtlLaunchConfigurationDelegate class from the
org.eclipse.m2m.atl.core.ui.launch package, then i changed the
"configuration" parameter of the launch method with my dataModel and i
modified the initialisations phase.
Everything works fine, just a little problem, all files (.asm, .uml, e...)
must be in my plugin project not somewhere else in the workspace.
thanks a lot
Previous Topic:Obtain SQL schema from UML class diagram
Next Topic:[ATL] Empty Stack
Goto Forum:
  


Current Time: Thu Apr 25 02:12:49 GMT 2024

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

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

Back to the top