cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing two or more service tasks

zahariuc_mihai
Champ in-the-making
Champ in-the-making
Hello,

I'm fairly new to Activiti so please go easy.
I have a process containing a starter, branching into 2 separate service tasks running asynchronously.
I need to make my process end after both have finished, basically if serviceTask1 finishes first, it should wait for the second and vice versa, but I can't really figure out how to do this.
Any suggestions?

Thanks,
Mihai
2 REPLIES 2

warper
Star Contributor
Star Contributor
Hi Mihai!
Generally process does not end until all executions end. So if you start with ParallelGateway and 2 service tasks after it, you are ok simply ending each line of execution with normal endEvent. If you need additional work after both service tasks, add parallelGateway after them and continue process from this point. Take a look at activiti user guide, similar case is explained in parallelGateway description.

Hi Warper,

That actually makes a lot of sense…don't know why I haven't tried this approach yet.
Thanks a lot for the reply. Smiley Happy