workflow not executed Both task if two service task as a part of parallel gateway.

Showing results for 
Search instead for 
Did you mean: 
Active Member

workflow not executed Both task if two service task as a part of parallel gateway.

Hi community,

we have integrated activity framework in my product version (Activiti - 5.15.1).

Only one service task is executed if two service task is connected as a output of parallel gateway, and found below error. here i have attached image of my workflow.


can any one give suggestion that how can possible to execute both  servide task while connected as a output of partallel gateway ?

only one entries found in  act_ru_job for perticular processinstance 

Here System Task1  is executed successful and service task (Private) is not executed and activity throws below error.


2018-03-16 20:33:19,411 DEBUG [org.activiti.engine.impl.persistence.entity.JobEntity.selectNextJobsToExecute] (Thread-101) ==> Parameters: 2018-03-16 20:33:19.411(Timestamp), 2018-03-16 20:33:19.411(Timestamp), 1(Integer), 2(Integer)
2018-03-16 20:33:19,412 DEBUG [org.activiti.engine.impl.interceptor.LogInterceptor] (pool-4-thread-104) --- ExecuteJobsCmd finished --------------------------------------------------------
2018-03-16 20:33:19,412 DEBUG [org.activiti.engine.impl.interceptor.LogInterceptor] (pool-4-thread-104)
2018-03-16 20:33:19,412 ERROR [org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable] (pool-4-thread-104) exception during job execution: null: java.lang.NullPointerException
at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(
at org.activiti.spring.SpringTransactionInterceptor.execute(
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

2018-03-16 20:33:19,422 DEBUG [org.activiti.engine.impl.persistence.entity.JobEntity.selectNextJobsToExecute] (Thread-101) <== Total: 0
2018-03-16 20:33:19,422 DEBUG [org.activiti.engine.impl.db.DbSqlSession] (Thread-101) flush summary: 0 insert, 0 update, 0 delete.


1 Reply
Alfresco Employee

Re: workflow not executed Both task if two service task as a part of parallel gateway.

I think you might be seeing a race condition. Whichever branch of the fork finishes first ends the process. If so you need a join before the end if you want both branches to be executed. It might be that one finishes before the other is even scheduled to run by the job executor.

The engine tests scenarios similar to this under Activiti/ at develop · Activiti/Activiti · GitHub  and the BPMN for those tests is at Activiti/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/gateway at develop · Activ...  I don't see your specific scenario of two service tasks on different sequence flows out from the fork but I think that's because you need to either have a join or have something that will stop the flow like a manual task in the branch in order to avoid a race condition. But if you're confident this condition can and should be addressed by the engine then it's an option to try to find an example out there of this scenario working and/or create a test case and see how to accommodate it with Activiti.