[AML] How to manage inherited properties? [message #656802] |
Mon, 28 February 2011 11:49  |
Eclipse User |
|
|
|
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:

- Evolved metamodel:

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
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04150 seconds