Home » Archived » M2M (model-to-model transformation) » Programatical launch of an ATL transformation from Ecore to Ecore
Programatical launch of an ATL transformation from Ecore to Ecore [message #88322] |
Thu, 14 August 2008 21:16 |
Eclipse User |
|
|
|
Originally posted by: monnet2.etu.unige.ch
Hello,
I am trying to do a programatical launch of an ATL transformation from
Ecore to Ecore but I am getting an error.
When I did the ATL transformation in Eclipse, I get a similar error and I
solved it by using the option "is a metametamodel" in the Run
Configuration of the ATL Eclipse plugin.
How can I set this option to the model handler in Java? Is there any
specific model handler for Ecore to Ecore transformations?
Thank you in advance for your help.
|
|
| | |
Re: Programatical launch of an ATL transformation from Ecore to Ecore [message #88523 is a reply to message #88474] |
Tue, 19 August 2008 09:36 |
Eclipse User |
|
|
|
Originally posted by: monnet2.etu.unige.ch
Hello Alfons,
First of all, thank you a lot for having taken some time for helping me. I
am still not able to get it working but I will keep on trying.
When you say to try adding a % to the model name, do you mean in the ATL
transformation or when calling the launch java method?
Thank you again for your help,
Xavier.
Alfons Laarman wrote:
> I didn't read your question correctly.
> To load a mm as mmm, try to put a % in front of the model name. I'm not sure
> about this, but I noticed it is done for MOF internally (%EMF).
> Regards,
> Alfons
> "Alfons Laarman" <a.w.laarman@student.utwente.nl> schreef in bericht
> news:g83k38$o1v$1@build.eclipse.org...
>> Hi Xavier,
>>
>> There is a map you passed to the ATLLauncher. Here you should set the
>> options. Try: options.put("allowInterModelReferences", true);
>>
>> regards,
>>
>> Alfons
>>
>> "Xavier Monnet" <monnet2@etu.unige.ch> schreef in bericht
>> news:49d4d1557ae3c1e75563b0e07c718fb2$1@www.eclipse.org...
>>> Hello,
>>>
>>> I am trying to do a programatical launch of an ATL transformation from
>>> Ecore to Ecore but I am getting an error.
>>>
>>> When I did the ATL transformation in Eclipse, I get a similar error and I
>>> solved it by using the option "is a metametamodel" in the Run
>>> Configuration of the ATL Eclipse plugin.
>>> How can I set this option to the model handler in Java? Is there any
>>> specific model handler for Ecore to Ecore transformations?
>>>
>>> Thank you in advance for your help.
>>>
>>>
>>
>>
|
|
| |
Re: Programatical launch of an ATL transformation from Ecore to Ecore [message #88567 is a reply to message #88537] |
Tue, 19 August 2008 17:16 |
Eclipse User |
|
|
|
Originally posted by: monnet2.etu.unige.ch
Hello Andy,
Here are the models I am passing to the launch method in my code:
ASMEMFModel leftInputModel = (ASMEMFModel)
modelHandler.loadModel("MOFLeft",(ASMEMFModel) modelHandler.getMof(),
URI.createFileURI(leftMMpath));
ASMEMFModel rightInputModel = (ASMEMFModel)
modelHandler.loadModel("MOFRight",(ASMEMFModel) modelHandler.getMof(),
URI.createFileURI(rightMMpath));
ASMEMFModel composedOutputModel = (ASMEMFModel)
modelHandler.newModel("MOF",
URI.createFileURI(outputFolder+"composedmm.ecore").toFileString(),
(ASMEMFModel) modelHandler.getMof());
// load models
models.put("MOFLeft", leftInputModel);
models.put("MOFRight", rightInputModel);
models.put("MOF", composedOutputModel);
Do you see something wrong in this?
Because then I get an error from the launcher saying:
Aug 19, 2008 7:06:59 PM org.eclipse.m2m.atl.engine.vm.SimpleDebugger error
SEVERE: ****** BEGIN Stack Trace
Aug 19, 2008 7:06:59 PM org.eclipse.m2m.atl.engine.vm.SimpleDebugger error
SEVERE: message: ERROR: could not find operation allInstancesFrom on
MOFLeft!EClass having supertypes: [MOFLeft!EClassifier, OclType, OclAny]
(including Java operations)
Aug 19, 2008 7:06:59 PM org.eclipse.m2m.atl.engine.vm.ExecEnv
printStackTrace
...
I was getting a similar error message (cannot find allInstancesFrom) with
Eclipse when I started using ATL. Checking the "is meta meta model" option
solved it.
That's why I was thinking that I was probably forgetting to specify that
option in Java. But I am already using the getMof() method. So, it's
probably something else. Do you have any idea on what can be causing the
error I am getting?
Thank you a lot for your help,
Xavier.
Andy Carpenter wrote:
> Xavier,
> The programmatic equivalent of checking the 'is a metametamodel'
> option on the launcher is to use the model returned by the getMof()
> method of the modelHandler as the meta-model for the ecore model(s).
> regards
> Andy.
> "Xavier Monnet" <monnet2@etu.unige.ch> wrote in message
> news:49d4d1557ae3c1e75563b0e07c718fb2$1@www.eclipse.org...
>> Hello,
>>
>> I am trying to do a programatical launch of an ATL transformation from
>> Ecore to Ecore but I am getting an error.
>>
>> When I did the ATL transformation in Eclipse, I get a similar error and I
>> solved it by using the option "is a metametamodel" in the Run
>> Configuration of the ATL Eclipse plugin.
>> How can I set this option to the model handler in Java? Is there any
>> specific model handler for Ecore to Ecore transformations?
>>
>> Thank you in advance for your help.
>>
>>
|
|
|
Re: Programatical launch of an ATL transformation from Ecore to Ecore [message #88642 is a reply to message #88567] |
Thu, 21 August 2008 07:22 |
Andy Carpenter Messages: 145 Registered: July 2009 |
Senior Member |
|
|
Xavier,
Your stack trace appears to show a problem with your
ATL transformation, I would have expected the same message
is the transformation was performed from the launcher.
The messages indicates that you're trying to use a method
called allInstancesFrom defined by Class that does exist. It look
likes you need to review the way in which you use this function.
Andy.
"Xavier Monnet" <monnet2@etu.unige.ch> wrote in message
news:a06636ffe9730cdc7263ea6753f3771e$1@www.eclipse.org...
> Hello Andy,
>
> Here are the models I am passing to the launch method in my code:
>
> ASMEMFModel leftInputModel = (ASMEMFModel)
> modelHandler.loadModel("MOFLeft",(ASMEMFModel) modelHandler.getMof(),
> URI.createFileURI(leftMMpath));
> ASMEMFModel rightInputModel = (ASMEMFModel)
> modelHandler.loadModel("MOFRight",(ASMEMFModel) modelHandler.getMof(),
> URI.createFileURI(rightMMpath));
> ASMEMFModel composedOutputModel = (ASMEMFModel)
> modelHandler.newModel("MOF",
> URI.createFileURI(outputFolder+"composedmm.ecore").toFileString(),
> (ASMEMFModel) modelHandler.getMof());
>
> // load models
> models.put("MOFLeft", leftInputModel);
> models.put("MOFRight", rightInputModel);
> models.put("MOF", composedOutputModel);
>
> Do you see something wrong in this?
>
> Because then I get an error from the launcher saying:
>
> Aug 19, 2008 7:06:59 PM org.eclipse.m2m.atl.engine.vm.SimpleDebugger error
> SEVERE: ****** BEGIN Stack Trace
> Aug 19, 2008 7:06:59 PM org.eclipse.m2m.atl.engine.vm.SimpleDebugger error
> SEVERE: message: ERROR: could not find operation allInstancesFrom on
> MOFLeft!EClass having supertypes: [MOFLeft!EClassifier, OclType, OclAny]
> (including Java operations)
> Aug 19, 2008 7:06:59 PM org.eclipse.m2m.atl.engine.vm.ExecEnv
> printStackTrace
> ..
>
> I was getting a similar error message (cannot find allInstancesFrom) with
> Eclipse when I started using ATL. Checking the "is meta meta model" option
> solved it.
>
> That's why I was thinking that I was probably forgetting to specify that
> option in Java. But I am already using the getMof() method. So, it's
> probably something else. Do you have any idea on what can be causing the
> error I am getting?
>
> Thank you a lot for your help,
> Xavier.
> Andy Carpenter wrote:
>
>> Xavier,
>
>> The programmatic equivalent of checking the 'is a metametamodel'
>> option on the launcher is to use the model returned by the getMof()
>> method of the modelHandler as the meta-model for the ecore model(s).
>
>> regards
>> Andy.
>
>> "Xavier Monnet" <monnet2@etu.unige.ch> wrote in message
>> news:49d4d1557ae3c1e75563b0e07c718fb2$1@www.eclipse.org...
>>> Hello,
>>>
>>> I am trying to do a programatical launch of an ATL transformation from
>>> Ecore to Ecore but I am getting an error.
>>>
>>> When I did the ATL transformation in Eclipse, I get a similar error and
>>> I solved it by using the option "is a metametamodel" in the Run
>>> Configuration of the ATL Eclipse plugin.
>>> How can I set this option to the model handler in Java? Is there any
>>> specific model handler for Ecore to Ecore transformations?
>>>
>>> Thank you in advance for your help.
>>>
>>>
>
|
|
|
Goto Forum:
Current Time: Sat May 04 12:27:38 GMT 2024
Powered by FUDForum. Page generated in 0.04069 seconds
|