cancel
Showing results for 
Search instead for 
Did you mean: 

Repeat a certain part of the process tree.

dognose
Champ in-the-making
Champ in-the-making
Hello,

we have a process on which we want to start 1 to n sub-processes, where we ofc. don't know n during designtime.

The subprocesses should be started, whenever a user completes a certain task on the parent process.
This certain Task however should stay available for further usage.

My first thought was to build a "loop", so whenever the "StartAnotherInstance"-Task is completed, a subprocess is started, and then the execution returns to another instance of the "StartAnotherInstance"-Task… However theres a problem, when 2 people are working at the same time. The one that first completes the "StartAnotherInstance"-Task will work, but the second one ofc. will work on an already completed task, and therefore can not complete it.

Is there a way to "complete" a Task (and let the execution continue) without actually "completing" the given task?

Basically a Task that can be completed infinite times, without beeing actually closed?

Maybe i'm running into the X-Y Problem here (http://meta.stackoverflow.com/questions/66377/what-is-the-xy-problem), and my desired Approach is not really the solution to my problem.

Any suggestions are welcome Smiley Happy
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Try to use multiinstance:
It works differently from your proposal but I think it could help.
http://www.activiti.org/userguide/#bpmnMultiInstance

dognose
Champ in-the-making
Champ in-the-making
Thx for your reply.

I already know the multiinstance, but that's unfortunately not going to work. If multiinstance is the "foreach" of BPMN, then i need to use the "while(true)" so to say 🙂

I have no list available on how often i need to repeat the certain process part. It's not predictable, because it only depends on how often a user clicks on a button. 

The process is about proposing different dates, times, locations etc for an event. Each proposal should be a subprocess, because there needs to be multiple approvals for each proposal.

So, Person A says "Let's make a beach party", 2 Persons approve and then the process should be in kind of a "waiting" state, where other people can propose the stuff above. So the Task "Propose Conditions" should last forever and every proposal should start a subprocess.

Something like this, so to say:

while (noLocationFixed){
  if (newProposal){
    startProposalSubprocess();
  }
}

trademak
Star Contributor
Star Contributor
What you are looking for is really specific to your use case. So what you could do is implement your own ActivityBehavior service task. From there you can fire off sub processes and still keep the task open until you want it to complete.

Best regards,