-
Bug Report
-
Resolution: Unresolved
-
L3 - Default
-
None
-
7.15.0-alpha5
-
None
Environment (Required on creation):
- Any Camunda distro on 7.15.0-alpha5
- Flag skipOutputMappingOnCanceledActivities is set to true
- Identified in the context of the RPA Bridge but applicable to External Tasks in general (possibly even to all activities)
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):
- Throwing a BPMN Error on an activity with an OutputMapping that is not caught (e.g. by a boundary event) leads to a NullPointerException in the OutputParameter because of no outer scope being present
java.lang.NullPointerException: null at org.camunda.bpm.engine.impl.core.variable.mapping.OutputParameter.execute(OutputParameter.java:52) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.core.variable.mapping.IoParameter.execute(IoParameter.java:51) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping.executeOutputParameters(IoMapping.java:45) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.destroy(ExecutionEntity.java:525) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationProcessEnd.eventNotificationsCompleted(PvmAtomicOperationProcessEnd.java:83) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationProcessEnd.eventNotificationsCompleted(PvmAtomicOperationProcessEnd.java:33) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:66) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:99) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:131) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:111) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:86) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:76) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:643) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:618) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:62) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:99) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:131) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:111) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:86) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:76) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:643) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:618) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:62) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:99) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:131) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:111) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:86) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:634) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:608) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityEnd.execute(PvmAtomicOperationActivityEnd.java:87) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityEnd.execute(PvmAtomicOperationActivityEnd.java:35) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:99) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:131) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:111) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:86) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:76) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:81) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:40) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:134) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:110) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:43) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:72) ~[camunda-engine-spring-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.3.4.jar!/:5.3.4] at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:70) ~[camunda-engine-spring-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:57) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:110) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:71) ~[camunda-engine-7.15.0-alpha5-ee.jar!/:7.15.0-alpha5-ee] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Steps to reproduce (Required on creation):
- Create an activity with an OutputMapping (can be one that always succeeds and does not rely on variables or anything else)
- Throw a BPMN error while on that activity (e.g. via API for an external task or Java Delegate or Script)
Observed Behavior (Required on creation):
- A NPE is thrown
Expected behavior (Required on creation):
- No NPE is thrown (either because the mapping is skipped or the behavior of the uncaught BPMN Error handling is changed)
Root Cause (Required on prioritization):
- The uncaught BPMN Error leads to a simulated None End Event behavior which does technically not cancel the activity, which is why for example the mentioned flag to skip mappings is not considered
- The activity as well as its parents are destroyed one after the other in ExecutionEntity#destroy - when the process instance is destroyed. The output parameter is executed twice: once when scope execution of the activity with the mapping is destroyed (=> expected) and once when the process instance execution is destroyed (=> not expected)
- PvmAtomicOperationActivityEnd sets the activity on the next higher execution after removal (https://github.com/camunda/camunda-bpm-platform/blob/7.14.0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/operation/PvmAtomicOperationActivityEnd.java#L66)
Solution Ideas (Optional):
Hints (Optional):
- Asynchronous continuation probably also needs to be considered here in case flag evaluation is expanded to cover this, as the None End Event behavior will be executed in the async continuation job context rather than in the execution context of throwing the BPMN Error itself and triggering that None End Event
Test case: https://github.com/camunda/camunda-bpm-platform/compare/CAM-13325-uncaught-error-extTask