Tasks getting duplicated

Hey, I have the following model:

36c3bebd29b6032490cf9d2d1e0d572c343ce3cb_2_1035x330

All good, it gets to where it needs to be:

However, three instances of the same task with slightly different ID are created, why?

Hey @fiki574,

Three instances are created because you have 3 flows going into the task.

After your first script task you have a parallel gateway that will create 3 new tokens. From those new tokens you go to an exclusive gateway which then goes to the user task.

You will need to have a parallel gateway before the user task and have 2 new exclusive gateways that will merge the flows from the top and bottom exclusive gateway with the appropriate HTTP tasks on their lines.

Cheers,
Filip

Hey, thanks for the response.

That’s kinda what I thought. I reconsidered my use case and realized I don’t really need a parallel gateway at all, so I’ve come up with the following model:

This now works as intended, tested all the possible flows, works good and in the end only one user task is created.

Thanks again nonetheless.

Just for future potential improvements have a look at the True Parallel Service Task Execution with Flowable. From 6.6 it will be possible to execute HTTP Tasks truly in parallel. With your second BPMN model you can’t use that, but with your first and my comment you would be able to do it ;).

1 Like

Sure, thanks for heads up.