camunda-platform-7-reactor icon indicating copy to clipboard operation
camunda-platform-7-reactor copied to clipboard

java.lang.NullPointerException: null at org.camunda.bpm.extension.reactor.bus.SelectorBuilder.extractTypeName(SelectorBuilder.java:223)

Open aminmc opened this issue 7 years ago • 4 comments

Hello I have a multi instance sub process and when i attach a boundary error catch event I get the following exception:

java.lang.NullPointerException: null
	at org.camunda.bpm.extension.reactor.bus.SelectorBuilder.extractTypeName(SelectorBuilder.java:223)

Exact code:

  static String extractTypeName(BpmnModelExecutionContext bpmnModelExecutionContext) {
    FlowElement bpmnModelElementInstance = bpmnModelExecutionContext.getBpmnModelElementInstance();
    return bpmnModelElementInstance.getElementType().getTypeName();
  }

This doesn't seem to be an issue if I attach a boundary timer event. According to the Camunda docs I should be able to attach a catch boundary error event on a multi instance sub process. Has anyone else noticed this issue?

Thanks

aminmc avatar May 08 '17 08:05 aminmc

Did not encounter this so far. I will create a test case to confirm.

jangalinski avatar May 08 '17 09:05 jangalinski

Hello @jangalinski , I was wondering if you were able to reproduce this issue?

aminmc avatar May 23 '17 13:05 aminmc

sorry, did not get to this point. Could you provide a reproducable example/snippet?

jangalinski avatar Dec 05 '17 13:12 jangalinski

Hi I get the same exception, this is an example bpmn file:

<?xml version="1.0" encoding="UTF-8" ?>
<bpmn:definitions
    xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
    xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
    xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
    xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
    xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    id="Definition_1"
    targetNamespace="http://bpmn.io/schema/bpmn">
  
  <bpmn:error id="Error" errorCode="error" name="error" />
  
  <bpmn:process id="TestMultiInstanceCallActivity" name="TestMultiInstanceCallActivity" isExecutable="true">
    
    <bpmn:startEvent id="Start" name="Start" />
    
    <bpmn:callActivity id="EmptyProcesses" name="Empty Processes" calledElement="EmptyProcess" >
        <bpmn:multiInstanceLoopCharacteristics isSequential="false"
           camunda:collection="${ids}" camunda:elementVariable="id" >
        </bpmn:multiInstanceLoopCharacteristics>
    </bpmn:callActivity>
    <bpmn:boundaryEvent id="EmptyProcessesError" attachedToRef="EmptyProcesses">
        <bpmn:errorEventDefinition errorRef="Error" />
    </bpmn:boundaryEvent>
    <bpmn:sequenceFlow id="FromEmptyProcessesErrorToEnd" name=""
                       sourceRef="EmptyProcessesError"
                       targetRef="End" />
    
    <bpmn:endEvent id="End" name="End" />
    
    
    <bpmn:sequenceFlow id="ToEmptyProcesses" name=""
                        sourceRef="Start"
                        targetRef="EmptyProcesses" />
    <bpmn:sequenceFlow id="ToEnd" name=""
                        sourceRef="EmptyProcesses"
                        targetRef="End" />
    
  </bpmn:process>

</bpmn:definitions>

The EmptyProcess is just a start event and an end event connected by a sequence flow. I use the following java code to start the process:

Set<String> ids = new HashSet<>();
ids.add("id1");
ids.add("id2");
Map<String,Object> variables = new HashMap<>();
variables.put("ids", ids);
processEngine.getRuntimeService().startProcessInstanceByKey("TestMultiInstanceCallActivity", variables);

AmselB avatar Mar 09 '19 22:03 AmselB