Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

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

Open
aminmc opened this issue May 8, 2017 · 4 comments
Assignees

Comments

@aminmc
Copy link

aminmc commented May 8, 2017

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

@jangalinski
Copy link
Collaborator

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

@jangalinski jangalinski self-assigned this May 8, 2017
@aminmc
Copy link
Author

aminmc commented May 23, 2017

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

@jangalinski
Copy link
Collaborator

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

@AmselB
Copy link

AmselB commented Mar 9, 2019

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);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants