In other words, I have a problem with navigating in ATL. In the figure below,
1. How can I reach "D" from "B"?
2. How can I reach "targets" from "source"?
3. How can I navigate from "C" to "A"?
4. if I have a class "E" which is inherited from "A", How can I navigate from "C" to "E"?
and as a final question, if "A" has more than one composition relation with elements, what change occurs? for example, in below picture, we want arrive "G" from "B".
it seems "B.refImmediateComposite().refImmediateComposite()" can not distinguish between "G" and "E".
An element can be contain only by one container. So you can have only E -> A -> B (and there is no G to reach), or G -> A -> B.
You should search for class diagram relationships if you have trouble with them.
Yes and it's fine in metamodel. I was talking about instantiated models. An instance of A can only be referred by a G or a E at once.
But in case you have simple relation of reference between yours objects, you can do something like :
G.allInstances()->select(G|G.g=A1) where A1 is referring to your A obtained by B.refImmediateComposite() for example.