Hi!
Iïm 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. Iïd 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.