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

cancel
Showing results for 
Search instead for 
Did you mean: 
nprajapatiasite
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.

Here 

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.

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(ExecuteJobsCmd.java:100)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:52)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

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.

Thanks

1 Reply
ryandawson
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/ParallelGatewayTest.java 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.