Dear Community,
I am trying to implement a cancelation pattern when parent instance
is canceled from one of the called process instances by throwing cancelation event to the event sup-process of the parent process (new users can put only one image in a post)
The event is correlated and the other called instance is being canceled successfully, however I get the following NPE when the code attempts to complete the parent instance.
It looks like the code attempts to process compensation logic by accessing the parent execution node which is null. This looks like a defect to me.
SEVERE: ENGINE-16006 BPMN Stack Trace:
EndEvent_0yvqfs7 (activity-end, Execution[25])
EndEvent_0yvqfs7
^
|
CallActivity_0a1mckm
^
|
EndEvent_0yvqfs7
^
|
CallActivity_15b8q80
^
|
UserTask_1
^
|
EndEvent_0yvqfs7
^
|
ExclusiveGateway_0d5diku
^
|
UserTask_1
Apr 20, 2016 11:24:43 AM org.slf4j.impl.JCLLoggerAdapter error
SEVERE: ENGINE-16004 Exception while closing command context: null
java.lang.NullPointerException
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.getFlowScopeExecution(PvmExecutionImpl.java:1299)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.getFlowScopeExecution(PvmExecutionImpl.java:1299)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.createActivityExecutionMapping(PvmExecutionImpl.java:1289)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityEnd.execute(PvmAtomicOperationActivityEnd.java:53)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityEnd.execute(PvmAtomicOperationActivityEnd.java:32)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:81)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:180)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:159)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:134)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:494)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:471)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityNotifyListenerEnd.eventNotificationsCompleted(PvmAtomicOperationActivityNotifyListenerEnd.java:42)
...
The workaround I’ve found is to use Async After on the Throw End Event, so that the failure doesn’t abort the current execution thread, but fail in the job executor, which appears to be capable of completing the instance despite the exception.
I’ve created a repro in the following repository: