Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [AML] How to manage inherited properties?
[AML] How to manage inherited properties? [message #656802] Mon, 28 February 2011 11:49 Go to next message
Eclipse UserFriend
Hi all,

I'm trying AML, which is in my opinion a really powerful tool, and I'm facing a problem with inherited properties. Here are my metamodels

- Former metamodel:

http://yuml.me/6abb9760

- Evolved metamodel:

http://yuml.me/69bf53c3

The difference between the two models is the fact that the relation between a Net and its components is direct in the former metamodel whereas it is inherited in the second metamodel. When I try to generate an ATL transformation thanks to AML, the net property isn't copy from the source model...

So I'd like to know if there is a special strategy to use or not? I mean I use the migration strategy I found in the Model Adaptation example (http://www.eclipse.org/m2m/atl/usecases/ModelAdaptation/) and I obtain this transformation:


-- @atlcompiler atl2006
module m12m2;
create OUT : rightpetrinetv3 from IN : leftpetrinetv2;

rule Net_Net {
 from
  s : leftpetrinetv2!Net
  (
   s.oclIsTypeOf(leftpetrinetv2!Net)
  )
 to
  t : rightpetrinetv3!Net (
   name <- s.name
  )
}

rule Place_Place {
 from
  s : leftpetrinetv2!Place
  (
   s.oclIsTypeOf(leftpetrinetv2!Place)
  )
 to
  t : rightpetrinetv3!Place (
   out <- s.out,
   in <- s.in,
   name <- s.name
  )
}

rule Transition_Transition {
 from
  s : leftpetrinetv2!Transition
  (
   s.oclIsTypeOf(leftpetrinetv2!Transition)
  )
 to
  t : rightpetrinetv3!Transition (
   in <- s.in,
   out <- s.out,
   name <- s.name
  )
}

rule PTArc_PTArc {
 from
  s : leftpetrinetv2!PTArc
  (
   s.oclIsTypeOf(leftpetrinetv2!PTArc)
  )
 to
  t : rightpetrinetv3!PTArc (
   src <- s.src,
   dst <- s.dst
  )
}

rule TPArc_TPArc {
 from
  s : leftpetrinetv2!TPArc
  (
   s.oclIsTypeOf(leftpetrinetv2!TPArc)
  )
 to
  t : rightpetrinetv3!TPArc (
   dst <- s.dst,
   src <- s.src
  )
}


The correct transformation should be something like:
rule Place_Place {
 from
  s : leftpetrinetv2!Place
  (
   s.oclIsTypeOf(leftpetrinetv2!Place)
  )
 to
  t : rightpetrinetv3!Place (
   out <- s.out,
   in <- s.in,
   name <- s.name,
   net <- s.net
  )
}


Regards,

Aurélien

[EDIT] image modifications in order to improve understandability

[Updated on: Wed, 02 March 2011 09:38] by Moderator

Re: [AML] How to manage inherited properties? [message #657310 is a reply to message #656802] Wed, 02 March 2011 06:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
You question is a little confusing. Perhaps you should describe exactly what you feel is not being transformed in the evolved model. Do you mean the Net EClass has no reference to EClass NetElement? If so your rule Net_Net doesn't seem to instruct any such mapping.
Regards,
Ronan
Re: [AML] How to manage inherited properties? [message #657358 is a reply to message #656802] Wed, 02 March 2011 09:46 Go to previous messageGo to next message
Eclipse UserFriend
Well, what I'm trying to explain is the fact that the net:Net attribute from Place, Transition, PTArc and TPArc are not set by the generated transformation. This attribute is inherited from NetElement Class.

The generated rule Place_Place:
rule Place_Place {
 from
  s : leftpetrinetv2!Place
  (
   s.oclIsTypeOf(leftpetrinetv2!Place)
  )
 to
  t : rightpetrinetv3!Place (
   out <- s.out,
   in <- s.in,
   name <- s.name
  )
}


The correct rule:
rule Place_Place {
 from
  s : leftpetrinetv2!Place
  (
   s.oclIsTypeOf(leftpetrinetv2!Place)
  )
 to
  t : rightpetrinetv3!Place (
   out <- s.out,
   in <- s.in,
   name <- s.name,
   net <- s.net
  )
}





Re: [AML] How to manage inherited properties? [message #657851 is a reply to message #657358] Fri, 04 March 2011 05:45 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------030700070309040803020208
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Aurelien,
I think the matching strategy offered by the Adaptation use case is
appropiate to the pair of metamodels you present in the previous post.
However, you need to flat the superclasses properties prior to the
matching strategy execution. To do that you can use the attached
transformation. You should execute such a transformation twice (the
initial metamodel and the evolving version). The matching strategy will
take as input the flatten metamodels.

Best regards,
Kelly.

--------------030700070309040803020208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BzZi51cHBlckJvdW5kLA0KCQkJZVR5cGUgPC0gc2YuZVR5cGUNCgkJKQ0K fQ0KDQpydWxl
IEF0dHJpYnV0ZSBleHRlbmRzIFN0cnVjdHVyYWxGZWF0dXJlIHsNCglmcm9t DQoJCXNmIDog
TWV0YW1ldGFtb2RlbCFFQXR0cmlidXRlLA0KCQljbCA6IE1ldGFtZXRhbW9k ZWwhRUNsYXNz
IA0KCXRvDQoJCXQgOiBNZXRhbWV0YW1vZGVsIUVBdHRyaWJ1dGUgKA0KCQkJ InVuaXF1ZSIg
PC0gc2YuInVuaXF1ZSINCgkJKQ0KfQ0KDQpydWxlIFJlZmVyZW5jZSBleHRl bmRzIFN0cnVj
dHVyYWxGZWF0dXJlIHsgDQoJZnJvbQ0KCQlzZiA6IE1ldGFtZXRhbW9kZWwh RVJlZmVyZW5j
ZSwNCgkJY2wgOiBNZXRhbWV0YW1vZGVsIUVDbGFzcw0KCXRvDQoJCXQgOiBN ZXRhbWV0YW1v
ZGVsIUVSZWZlcmVuY2UgKA0KCQkJLS1jb250YWluZXIgPC0gc2YuY29udGFp bmVyDQoJCSkN
Cn0NCg==
--------------030700070309040803020208--
Re: [AML] How to manage inherited properties? [message #659998 is a reply to message #657851] Wed, 16 March 2011 10:19 Go to previous message
Eclipse UserFriend
Thanks Kelly for your message, and thanks all for the work you do on AML Project.
Previous Topic:[QVTO] CST, Pretty Printer
Next Topic:[QVTo] Sending objects to transformation
Goto Forum:
  


Current Time: Sun Aug 31 03:30:59 EDT 2025

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

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

Back to the top