[ATL] How to reference object of different metamodels [message #64965] |
Mon, 29 October 2007 17: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 22: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 #65065 is a reply to message #65045] |
Tue, 30 October 2007 06:58 |
Eclipse User |
|
|
|
Originally posted by: eric.maes.thalesgroup.com
Freddy Allilaire wrote:
> Did you check the option "Allow inter-model references" in the Advanced
> tab of your launch configuration?
I am launching the transformation programmatically.
The AtlLaucher launch method does not seem to offer the possibility to
specify the "Allow inter-model references" parameter.
Is there a way to specify it without using the launch configuration ?
Regards
|
|
|
|
Re: [ATL] How to reference object of different metamodels [message #65108 is a reply to message #65086] |
Wed, 31 October 2007 13:50 |
Eclipse User |
|
|
|
Originally posted by: eric.maes.thalesgroup.com
> If you look at the generated Mo1 file (in text format),
> is the reference feature set ?
No, the reference feature is not set.
> Do you encounter an error when opening the file with the ecore editor ?
I have no problem opening Mo1 or Mo2 but in the generated files, there are
no inter-model reference (see previous answer).
|
|
|
|
Re: [ATL] How to reference object of different metamodels [message #65426 is a reply to message #65130] |
Fri, 02 November 2007 10: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.02890 seconds