NPE in CdiEventListener when leaving MultiInstanceActivity

XMLWordPrintable

    • Type: Bug Report
    • Resolution: Fixed
    • Priority: L3 - Default
    • 7.3.0, 7.3.0-alpha4
    • Affects Version/s: 7.1.4
    • Component/s: 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.

            Assignee:
            Thorben Lindhauer
            Reporter:
            Patrick Steinig
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: