cancel
Showing results for 
Search instead for 
Did you mean: 

ParallelGateway for Service Task

lojian
Champ in-the-making
Champ in-the-making
As we know that ParallelGateway could fork all outgoing sequence flows, create one concurrent execution for each sequence flow.
My question here is, ”concurrent" here means "each flow is running in different thread" ?
17 REPLIES 17

jbarrez
Star Contributor
Star Contributor
No, Activiti does not spawn new threads. All outgoing sequence flow are taken in the same transaction (plus all automatic paths that follow). If you were to do that in different threads, this would cause unneeded delays and locking problems.

lojian
Champ in-the-making
Champ in-the-making
Thank you very much! Smiley Very Happy

actuser
Champ in-the-making
Champ in-the-making
Hi,
Just raising this question again. Can using "asynchronous continuations" provide this type of 'concurrency' for service tasks on separate sequence flows of a parallel gateway, i.e. the service tasks will be executed concurrently in different background threads ??

Thanks..

trademak
Star Contributor
Star Contributor
Hi,

We're currently implementing a patch for this.
Right now you can only have one async continuation after the parallel gateway.
So if you have multiple outgoing paths with async continuations, you'll be running into errors.
But we have a patch on one of the branches right now that overcomes this. So it will certainly be in the Activiti 5.9 release.

Best regards,

actuser
Champ in-the-making
Champ in-the-making
Thanks for that info.  Will there be any limitations with this fix like, for example, imposing a limit on the number of asynchronous continuations (e.g. 2) that can be modelled after a parallel gateway ?  We have a requirement to run several service tasks concurrently in a part of our workflow, so at the moment this seems to be the only way possible that we could meet that requirement using the activiti workflow engine.

jsher
Champ in-the-making
Champ in-the-making
Hi,

I also would like to see the removal of the restriction on number of async continuations after a parallel gateway. Hopefully the fix will make it into next release as you say.

A related question… are there any similar restrictions on
(i) the number of concurrent user tasks after a parallel gateway ?
(ii) the the number of concurrent receive tasks after a parallel gateway ?

Many thanks
    James

trademak
Star Contributor
Star Contributor
Hi,

No after the patch there will be no limitations.

Best regards,

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
no limitations besides maybe the number of concurrent job executors?

actuser
Champ in-the-making
Champ in-the-making
Hi,
Is there any way I can get the code for this patch in order to merge it into our Activiti 5.8 code base ?  I'd like to do some testing with our model before the Activiti 5.9 release.
Thanks again.
John