WorkPool.allinstances.buffInProcess->union(WorkPool.allinstances.buffopenplans)->union(Workpool.allinstances.buffforwarded)
So in this case Workpool contain some buffers or multilinks. I want to merge 3 multilinks into one list.
It can be done with collect.
WorkPool.allinstances->collect(buffInProcess->union(buffopenplans)->union(buffforwarded))
The result is exact the same but you do not need to use WorkPool.allinstances on many places.
Another case
Instead of
if myLooongexpression.condition then
myLooongexpression.attributeone
myLooongexpression.attributeone
else
myLooongexpression.attributetwo
endif
do this
myLooongexpression->collect(if condition then attributeone else attributetwo endif)