ATL polymorphism [message #79566] |
Fri, 18 April 2008 12:10 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: marta.rivera.opensynergy.com
Hi!
Im trying to transform a model with a chain of aggregations to another
with an inheritance chain:
class a ------- transformation to ------> class A
owns 0..1 instanceOfb owns 0..* instanceOfB
class b class B (abstract)
inherits
owns 0..* instanceOfd class C (abstract)
inherits
class d ------- transformation to ------> class D
For the transformation only the first and last classes of the chain are
interesting. Id tryed:
rule one {
from i: model1!a
to o: model2!A (
attribute <- i.attribute,
instanceOfB.D <- i.instanceOfb.instanceOfd
-- syntax error: mismatched input . expected LARROW
instanceOfB <- (i. instanceOfb. instanceOfd).oclAsType(model2!D)
--ClassCastException
)
}
Which is the right way write the rule?
Thank you in advance.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03930 seconds