1 Reply Latest reply on Nov 21, 2007 3:38 PM by kukeltje

    a foreach algorithm

    starbuxman

      Hello,

      Is there a way to have a foreach type of construct? In plain 'ol JBPM JPDL (not BPEL)?

      More specifically, I want to be able to pass in (say) a java.util.List as a process variable and have it create new branches for each obect in the node and put the object as a process variable in that branch. So,

      List carIds =Arrays.asList(1,2,3,4) ;

      yeilds 4 execution paths of the same 'node' (be it a task-node, or a sub process node (!)) and have those nodes execute with a unique 'carId' variable. Thus, each, say, task-node would be queued up and waiting. If you had 4 people hitting a queue list, theyd see 4 new things to do (whatever it is) and 4 people could do the work in the time of 1. They'd parallelize.

      Ideally, the branches of execution would join and then the flow would continue from there.

      Has anyway seen a way to do this? I know these sorts of contstructs are supported in some ways, but I'd love to know how? Is there some sort of Action or class I can use?

      Thanks in advance,

      Josh