-
Type:
Bug Report
-
Resolution: Fixed
-
Priority:
L3 - Default
-
Affects Version/s: None
-
Component/s: None
-
None
Created on behalf of PR:
initial - https://github.com/camunda/camunda-bpm-platform/pull/732
current - https://github.com/camunda/camunda-bpm-platform/pull/997
Scenario:
- Process instance with call activity that has an escalation boundary event, after the event follows end event.
- The call activity calls a process instance that has a user task, followed by an escalation end event
- Execute
runtimeService.createProcessInstanceModification(taskInSubProcess.getProcessInstanceId()) .cancelAllForActivity("task") .startAfterActivity("task") .execute(); - Java test: https://github.com/camunda/camunda-bpm-platform/pull/732/files#diff-401ece06f7c932aa074753f1fab02e50R1811-R1834
Expected:
The subprocess and the parent process complete successfully
Observed:
NPE is thrown
java.lang.NullPointerException: null at org.camunda.bpm.engine.impl.util.ModificationUtil.handleChildRemovalInScope(ModificationUtil.java:54) ~[classes/:na] at org.camunda.bpm.engine.impl.cmd.ModifyProcessInstanceCmd.deletePropagate(ModifyProcessInstanceCmd.java:158) ~[classes/:na] at org.camunda.bpm.engine.impl.cmd.ModifyProcessInstanceCmd.execute(ModifyProcessInstanceCmd.java:90) ~[classes/:na] at org.camunda.bpm.engine.impl.cmd.ModifyProcessInstanceCmd.execute(ModifyProcessInstanceCmd.java:1) ~[classes/:na] at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28) ~[classes/:na] at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110) ~[classes/:na] at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70) ~[classes/:na] at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) ~[classes/:na] at org.camunda.bpm.engine.impl.ProcessInstanceModificationBuilderImpl.execute(ProcessInstanceModificationBuilderImpl.java:265) ~[classes/:na] at org.camunda.bpm.engine.impl.ProcessInstanceModificationBuilderImpl.execute(ProcessInstanceModificationBuilderImpl.java:256) ~[classes/:na] at org.camunda.bpm.engine.impl.ProcessInstanceModificationBuilderImpl.execute(ProcessInstanceModificationBuilderImpl.java:251) ~[classes/:na] at org.camunda.bpm.engine.test.bpmn.callactivity.CallActivityTest.testCallSimpleSubProcessWithModificationEscalationEnd(CallActivityTest.java:1834) ~[test-classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121] at junit.framework.TestCase.runTest(TestCase.java:176) [junit-4.12.jar:4.12] at junit.framework.TestCase.runBare(TestCase.java:141) [junit-4.12.jar:4.12] at org.camunda.bpm.engine.impl.test.AbstractProcessEngineTestCase.runBare(AbstractProcessEngineTestCase.java:115) ~[classes/:na] at junit.framework.TestResult$1.protect(TestResult.java:122) [junit-4.12.jar:4.12] at junit.framework.TestResult.runProtected(TestResult.java:142) [junit-4.12.jar:4.12] at junit.framework.TestResult.run(TestResult.java:125) [junit-4.12.jar:4.12] at junit.framework.TestCase.run(TestCase.java:129) [junit-4.12.jar:4.12] at junit.framework.TestSuite.runTest(TestSuite.java:252) [junit-4.12.jar:4.12] at junit.framework.TestSuite.run(TestSuite.java:247) [junit-4.12.jar:4.12] at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86) [junit-4.12.jar:4.12] at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89) [.cp/:na] at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) [.cp/:na] at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:542) [.cp/:na] at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770) [.cp/:na] at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464) [.cp/:na] at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) [.cp/:na]
Hints:
The Exception is thrown as the instance is already finished due to the immediate propagation of the escalation event. However, the modification implementation doesn't consider the case at the moment and still tries to propagate deletion to the parent.
We should consider skipping the further handle in such case.