Chris S
Chris S

Reputation: 151

Workflow: how to use a sequence instead of foreach?

Given such activities in JPDL:

<foreach in="#{itms}" name="foreach1" var="itm">
    <transition name="to_task_activity" to="task_activity" />
</foreach>

<task name="task_activity">
    <transition to="join1" />
</task>

<join multiplicity="#{count}" name="join1">
    <transition to="further_activity" />
</join>

Is it possible (and how) to use another construction instead of this, so that task_activity may be done not asynchronously, but sequentially for each item from the collection itms?

Upvotes: 1

Views: 204

Answers (1)

George
George

Reputation: 357

My previous answer was incorrect, you cannot increment variables and loop using a <decision> block to end the loop. Incrementing variables is disallowed in jPDL.

What I am testing is a <foreach in="0,1,2,3"> initiated using an array list of numbers. If you already know the multiplicity of the join, then you can store a finite array variable in Java then access the array index from the variable x in <foreach var="x">. The Java variable is then global in the <foreach>, and can be accessed with the given index.

Still working on an example.

Upvotes: 0

Related Questions