For-Loop: Getting the context of the outer element [message #1765345] |
Thu, 08 June 2017 15:09 |
William Coh Messages: 15 Registered: June 2017 |
Junior Member |
|
|
Hey there,
after my "Begin" starts, I'll set the context to InstanceA (TypeA). Then the system iterates through a For-Loop (size n = depending on TypeZ which has nothing to do with InstanceA).
Inside this For-Loop, I want to create n new instances of TypeB and assign each of those instances to InstanceA (InstanceA holds a collection of elements of TypeB).
However, the For-Loop automatically changes the context to instances of TypeZ and I can't see how I can access InstanceA from inside the For-Loop, because there is no connection between TypeA and TypeZ in my underlying model.
e.g. aql:self returns an instance from TypeZ
Is there a way to access my InstanceA from inside the For-Loop?
[Updated on: Thu, 08 June 2017 15:10] Report message to a moderator
|
|
|
|
|
Re: For-Loop: Getting the context of the outer element [message #1765398 is a reply to message #1765376] |
Fri, 09 June 2017 08:16 |
Pierre Guilet Messages: 250 Registered: June 2017 |
Senior Member |
|
|
Yes, the structure I gave you start from your first context.
A did a picture to represent a working usage similar to yours:
This should work if everything else is ok.
To know what a let can have, juts right click on it and you will have all operations you can use that is all operations.
If this does not work, be sure all your expressions are correct and that you have no warnings about those in error log.
Also make sure the refrence in the create instance is correct.
I also wonder how you retrieve typeZ in for loop if they have no links with type A?
Regards,
Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
[Updated on: Fri, 09 June 2017 08:20] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04345 seconds