AnsweredAssumed Answered

Multi instance sub process is not working as expected in activiti 6

Question asked by avinash8806 on Oct 31, 2017

Hi,

Currently we are using activiti 5.19 version and planning to upgrade it to version 6 and in the process we are noticing few issues. We have lot of call activities and subprocesses which run in parallel using multiinstanceloopcharacteristics. 

 

After the upgrade, the flow is stuck at multi instance sub process and the engine is creating multiple jobs and multiple executions exponentially.  I created a test work flow with one multi instance subprocess and I see the same problem occurring. I see the below exception stack trace printing repeatedly when I enabled activiti logs.

 

2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.interceptor.LogInterceptor - --- starting --------------------------------------------------------
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.s.SpringTransactionInterceptor - Running command with propagation REQUIRES_NEW
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.a.DefaultActivitiEngineAgenda - Operation class org.activiti.engine.impl.interceptor.CommandInvoker$1 added to agenda
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.p.e.JobEntityImpl.selectJob - ==> Preparing: select * from ACT_RU_JOB where ID_ = ?
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.p.e.JobEntityImpl.selectJob - ==> Parameters: 3248705(String)
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.p.e.JobEntityImpl.selectJob - <== Total: 0
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] ERROR o.a.e.i.interceptor.CommandContext - Error while closing command context
java.lang.NullPointerException: null
at org.activiti.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:151) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:35) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.persistence.entity.AbstractEntityManager.delete(AbstractEntityManager.java:87) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:137) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:35) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.persistence.entity.AbstractEntityManager.delete(AbstractEntityManager.java:82) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.asyncexecutor.DefaultJobManager.unacquire(DefaultJobManager.java:230) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor.executeAsyncJob(DefaultAsyncJobExecutor.java:133) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.jobexecutor.AsyncJobAddedNotification$1.execute(AsyncJobAddedNotification.java:50) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.jobexecutor.AsyncJobAddedNotification$1.execute(AsyncJobAddedNotification.java:45) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:37) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:78) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:57) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:42) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:48) ~[activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:63) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) [activiti-spring-6.0.0.jar:6.0.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) [activiti-spring-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:35) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.RetryInterceptor.execute(RetryInterceptor.java:47) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.jobexecutor.AsyncJobAddedNotification.closed(AsyncJobAddedNotification.java:45) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandContext.executeCloseListenersClosed(CommandContext.java:175) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:93) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) [activiti-spring-6.0.0.jar:6.0.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) [activiti-spring-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:35) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.interceptor.RetryInterceptor.execute(RetryInterceptor.java:47) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:39) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:97) [activiti-engine-6.0.0.jar:6.0.0]
at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:75) [activiti-engine-6.0.0.jar:6.0.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f avenna [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.interceptor.LogInterceptor - --- finished --------------------------------------------------------
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.interceptor.LogInterceptor -

2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.interceptor.LogInterceptor - --- ExecuteAsyncJobCmd finished --------------------------------------------------------
2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.interceptor.LogInterceptor -

2017-10-30 23:32:43 59f7fcdba7c812f9841de26f  [activiti-async-job-executor-thread-2] DEBUG o.a.e.i.interceptor.LogInterceptor -

 

Please let me know if there is anything missing from my side or is this a bug? I am attaching the sample bpmn i am testing and let me know if any additional details are required. Any sort of help is appreciated.

 

Thanks,

Avinash V

Attachments

Outcomes