Issue with executing service tasks using parallel gateway

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

Issue with executing service tasks using parallel gateway

We are using activiti 5.22.0 . We are trying to execute service tasks parallely, using parallel gateway with async true(for service task and parallel gateway) and exclusive:false. Also we have added the below entry in config file 

<property name="jobExecutorActivate" value="true" />
<property name="asyncExecutorActivate" value="true" />

Still the service tasks execution is happening sequentially. Can someone please help us to understand what are we missing.

3 Replies
Highlighted
Senior Member

Re: Issue with executing service tasks using parallel gateway

Ok, what do you mean by sequentially? How are you testing that those are happening in sequence? 

What is most likely to happen is that you schedule two jobs in the job executor and one will be picked up first (usually the first job that is schedule) and then , depending on how many executor threads do you have, the next job will be picked up. Using the job executor and async usually make sense when the Jobs are long running things, if the jobs end really quick.. it will look sequential, but as soon as the jobs are scheduled the job executor should deal with them in parallel. 

Hope this helps. 

Highlighted
Member II

Re: Issue with executing service tasks using parallel gateway

Hi, 

Thanks for the response.

I have 5 service tasks , all this five i have given in the parallel gateway and given loggers at the beginning and end of each task. All my tasks, which are external service call are taking more than 2 secs. From the log i can clearly see that first the service task 1 starts and completes then the second service and so on. That is how i came to the conclusion it is running sequentially. What i am expecting to see service task start logs for all the tasks first and after then service task end logs, since each task is taking at least 2 seconds.

Highlighted
Senior Member

Re: Issue with executing service tasks using parallel gateway

As I mention before, the gateway schedule the tasks in order.. meaning that job requests are created sequentially, and because the tasks only takes 2 seconds to complete it is very likely to see them starting and completing in order. 

Have you read the docs? -> Activiti User Guide