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

NPE in CdiEventListener when leaving MultiInstanceActivity

XMLWordPrintable

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 7.3.0, 7.3.0-alpha4
    • 7.1.4
    • engine

      I modelled a ServiceTask with multiinstance behaviour (asynchronous and sequential). The task implementation extends AbstractBpmnActivityBehavior.
      Furthermore I configured the engine to use the "CdiEventSupportBpmnParseListener" to use the cdi event mechanism.

      If there is more than one execution for the multiinstance activity the leave()-method fails with a NullPointerException in the CdiEventListener because there is no execution context.
      org.camunda.bpm.engine.cdi.impl.event.CdiEventListener:
      protected BusinessProcessEvent createEvent(DelegateExecution execution) {
      ProcessDefinitionEntity processDefinition = Context.getExecutionContext().getProcessDefinition();

      The createEvent(DelegateTask task)-method in the same class checks first if there is a ExecutionContext. After changing the createEvent()-method for an DelegateExecution to do the same it works or at least there is no exception.

      I attached a test project to reproduce the exception. To run the junit test include the jar in \lib directory in classpath to get the cdi container running.

        This is the controller panel for Smart Panels app

              thorben.lindhauer Thorben Lindhauer
              PatSt Patrick Steinig
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: