Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] How to reference object of different metamodels
[ATL] How to reference object of different metamodels [message #64965] Mon, 29 October 2007 17:09 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #65086 is a reply to message #65065] Tue, 30 October 2007 17:17 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010309050807080908020500
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

First, I look at the adt plugin code and it seems that the "Allow
inter-model references" checkbox has no effect in the current CVS
version... but the default value is true, so normally you should'nt have
problems to make inter-model references.

If you look at the generated Mo1 file (in text format), is the reference
feature set ? Do you encounter an error when opening the file with the
ecore editor ?

Best regards,

William

Eric MAES a
Re: [ATL] How to reference object of different metamodels [message #65108 is a reply to message #65086] Wed, 31 October 2007 13:50 Go to previous messageGo to next message
Eclipse UserFriend
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 #65130 is a reply to message #65108] Wed, 31 October 2007 14:22 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030503000003030405080307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

I tried to make a transformation like yours and it works using the
normal launchConfiguration. The Mo1 to Mo2 is correctly set.
So perhaps the problem comes from the way you call the AtlLauncher.

Normally, the "allowInterModelReference" attribute is related to the
"checkSameModel" attribute of the ASMEMFModel class.

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.

Regards,

William
Eric MAES a
Re: [ATL] How to reference object of different metamodels [message #65426 is a reply to message #65130] Fri, 02 November 2007 10:06 Go to previous message
Eclipse UserFriend
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
Previous Topic:Re: [AM3] ATL transformation Ant Task
Next Topic:RCP feature/patch error installing ATL
Goto Forum:
  


Current Time: Sun Apr 11 02:04:12 GMT 2021

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

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

Back to the top