[ATL] How to reference object of different metamodels [message #64965] |
Mon, 29 October 2007 13:09  |
Eclipse User |
|
|
|
Originally posted by: eric.maes.thalesgroup.com
I'll try to be as clear as possible to explain my problem.
Please ask me for details if it is not enough.
I'd like to do a transformation from an input model Mi to 2 output models,
Mo1 and Mo2.
Mo1 and Mo2 have different metamodels MMo1 and MMo2.
In MMo1, an element ElementWithReference has a reference to an element
ElementToReference in MMo2.
With the following transformation, the reference is not filled!
create Mo1 : MMo1, Mo2 : MMo2 from Mi : MMi
rule MyRule {
from
element:MMi!Element
to
eWR:MMo1!ElementWithReference (
reference <- eTR
),
eTR:MMo2!ElementToReference
}
The two elements are correctly created in Mo1 and Mo2 but the Mo1
ElementWithReference reference field is empty.
In practice, when the two models are created, I can correct the
transformation by loading the resource Mo2 from Mo1 and then give the
correct value to the reference field.
Is there a way to do such things in an ATL transformation ?
|
|
|
Re: [ATL] How to reference object of different metamodels [message #65045 is a reply to message #64965] |
Mon, 29 October 2007 18:58   |
Eclipse User |
|
|
|
Originally posted by: freddy.allilaire.univ-nantes.fr
Hi Eric,
Did you check the option "Allow inter-model references" in the Advanced
tab of your launch configuration?
Regards,
Freddy.
Eric MAES a écrit :
> I'll try to be as clear as possible to explain my problem.
> Please ask me for details if it is not enough.
>
> I'd like to do a transformation from an input model Mi to 2 output
> models, Mo1 and Mo2.
> Mo1 and Mo2 have different metamodels MMo1 and MMo2.
>
> In MMo1, an element ElementWithReference has a reference to an element
> ElementToReference in MMo2.
>
> With the following transformation, the reference is not filled!
>
> create Mo1 : MMo1, Mo2 : MMo2 from Mi : MMi
> rule MyRule {
> from
> element:MMi!Element
> to
> eWR:MMo1!ElementWithReference (
> reference <- eTR
> ),
> eTR:MMo2!ElementToReference
> }
>
> The two elements are correctly created in Mo1 and Mo2 but the Mo1
> ElementWithReference reference field is empty.
>
> In practice, when the two models are created, I can correct the
> transformation by loading the resource Mo2 from Mo1 and then give the
> correct value to the reference field.
>
> Is there a way to do such things in an ATL transformation ?
>
|
|
|
|
|
|
|
Re: [ATL] How to reference object of different metamodels [message #65426 is a reply to message #65130] |
Fri, 02 November 2007 06:06  |
Eclipse User |
|
|
|
Originally posted by: eric.maes.thalesgroup.com
William Piers wrote:
> If you use the AtlLauncher class to launch transformation, I suppose
> that you load models before : at this state you may use the
> "setCheckSameModel" method to fix the attribute to "false". Look at the
> class org.eclipse.m2m.atl.adt.launching.AtlRegularVM for an example.
Fixing the checkSameModel ASMEMFModel attribute to false makes the
transformation working.
Thanks for your help.
Best regards
|
|
|
Powered by
FUDForum. Page generated in 0.08466 seconds