Target Model:
CarSystem --> CarSeat where Filesystem corresponds to Sytem, but CarSeat has an attribute which combines the name of Car and Seat, e.g. if car="Mercedes" and "Seat"="BlackSeat", then CarSeat.name should be "Mercedes-BlackSeat".

I found some tutorials which used resolveTemp to generate the required link, but the problem here is that there are multiple associations over 2 levels and furthermore one target class combines two source classes.

Please help me to solve the problem! Please take especially a loop at the nested collect-resolve-temp line. If there is only one level it works for me, but if I want to collect all the seats, which is at level 2, it doesn't work. Why? How to solve that in ATL (if possible without DO-constructs).

]]>Andreas Grünwald2012-12-13T00:32:36-00:00Re: resolveTemp over several associationshttps://www.eclipse.org/forums/index.php/mv/msg/441471/990572/#msg_990572
When you have :

from
car: in!Car,
seat: in!Seat

nothing says that the seat is linked to the car.
This means that you can enter this rule with a seat and a car without having the seat belonging to the car.
Simply transform a Seat to a CarSeat and from the seat I assume you can easily get the corresponding car (if there's no direct eReference you can probably use refImmediateComposite() which returns the owner of an element).

If you do it that way then in your System rule you just have to collect all the seats. No need to use resolveTemp :

]]>Sylvain EVEILLARD2012-12-13T08:52:04-00:00Re: resolveTemp over several associationshttps://www.eclipse.org/forums/index.php/mv/msg/441471/990652/#msg_990652
I wanted to do it the following way, which seemed intuitive, but didn't work out.
name <- seat.refImmediateComposite().oclAsType(System!Car).name + '-' +seat.name

EDIT:
Ok, meanwhile I think I found it out:
name <- seat.refImmediateComposite().refGetValue('name') + '-' +seat.name

ATL isn't very intuitive, isn't it?

Thank you very much for your help!!!]]>Andreas Grünwald2012-12-13T15:21:22-00:00Re: resolveTemp over several associationshttps://www.eclipse.org/forums/index.php/mv/msg/441471/990658/#msg_990658