Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-13325

Uncaught BPMN Error leads to NullPointerException in OutputMapping on External Task

    • Icon: Bug Report Bug Report
    • Resolution: Unresolved
    • Icon: L3 - Default L3 - Default
    • None
    • 7.15.0-alpha5
    • engine
    • 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):

      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

        This is the controller panel for Smart Panels app

            [CAM-13325] Uncaught BPMN Error leads to NullPointerException in OutputMapping on External Task

            Tobias Metzke-Bernstein created issue -
            Tobias Metzke-Bernstein made changes -
            Description Original: h4. 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)

            h4. 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

            {code}
            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]
            {code}

            h4. 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)

            h4. Observed Behavior (Required on creation):
            * A NPE is thrown

            h4. 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)

            h4. 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, it also executes the mappings the activity had attached and runs into the NPE because it does not have an outer scope

            h4. Solution Ideas (Optional):


            h4. Hints (Optional):


            New: h4. 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)

            h4. 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

            {code}
            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]
            {code}

            h4. 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)

            h4. Observed Behavior (Required on creation):
            * A NPE is thrown

            h4. 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)

            h4. 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, it also executes the mappings the activity had attached and runs into the NPE because it does not have an outer scope

            h4. Solution Ideas (Optional):


            h4. 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
            Tobias Metzke-Bernstein made changes -
            Mentioned Roles
            Tobias Metzke-Bernstein made changes -
            Mentioned Groups
            Tobias Metzke-Bernstein made changes -
            Affects Version/s New: 7.15.0-alpha5 [ 16710 ]
            Tobias Metzke-Bernstein made changes -
            Assignee New: Thorben Lindhauer [ thorben.lindhauer ]
            Tobias Metzke-Bernstein made changes -
            Mentioned Roles
            Tobias Metzke-Bernstein made changes -
            Mentioned Groups
            Tobias Metzke-Bernstein made changes -
            Status Original: Open [ 1 ] New: Ready [ 10005 ]

            Thorben Lindhauer added a comment - Test case: https://github.com/camunda/camunda-bpm-platform/compare/CAM-13325-uncaught-error-extTask
            Thorben Lindhauer made changes -
            Mentioned Roles
            Thorben Lindhauer made changes -
            Mentioned Groups

              thorben.lindhauer Thorben Lindhauer
              tobias.metzke Tobias Metzke-Bernstein
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: