[Acceleo 3]Decision outgoing are switching [message #718494] |
Wed, 24 August 2011 09:58  |
Eclipse User |
|
|
|
Hi everybody,
every generation i do my outgoing flows from a decision node are switching. I do:
[outgoing->asOrderedSet()->first().name/]
[outgoing->asOrderedSet()->last().name/]
if there are 2 outgoing flows called OF1,OF2 the return is:
OF1
OF2
and after one or more generation it switches to:
OF2
OF1
and back.
Greetings,
Norman
|
|
|
|
Re: [Acceleo 3]Decision outgoing are switching [message #719141 is a reply to message #719120] |
Fri, 26 August 2011 03:35  |
Eclipse User |
|
|
|
Hi Norman,
The problem here is that the "outgoing" reference is not ordered. The "asOrderedSet" method indeed takes its values and make sure that further calls will always be in the same order... but the original collection being in a random order, the new ordered set, that takes its own order from that original collection, will also be random.
I can see two choices here. Either you use the ordered "eContents" as you did here, or you re-sort the collection yourself. Something like this should do :
node.outgoing->asOrderedSet()->sortedBy(name)
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.25654 seconds