Make BPMN Parser aware of an Extension

Hello,

I extended the bpmn-js modeler (the one with camunda extensions) with location events. To do so I created a new EventDefinition called “locationEventDefinition”. I can use the new events in the modeler. But when I try to deploy the BPMN diagram this error shows up:

ENGINE-09005 Could not parse BPMN process. Errors:
*cvc-complex-type.2.4.a: Invalid content was found starting with element ‘{“someNS”:locationEventDefinition}’. One of ‘{“bpmnNS”:outgoing, “bpmnNS”:property, bpmnNS":dataOutput, “bpmnNS”:dataOutputAssociation, “bpmnNS”:outputSet, “bpmnNS”:eventDefinition, “bpmnNS”:eventDefinitionRef}’ is expected.

(bpmnNS = http://www.omg.org/spec/BPMN/20100524/MODEL, because I can only post two links in a post)
The XML looks like this:

    <bpmn2:startEvent id="StartEvent_1" name="test">
      <bpmn2:outgoing>Flow_06vvlre</bpmn2:outgoing>
      <loc:locationEventDefinition id="LocationEventDefinition_156ha45" eventType="entersGeofence" distanceThreshold="123" distanceType="linearDistance" location1="123" location2="123" polygonPoints="123" />
    </bpmn2:startEvent>

So my question is: How can I make the BPMN parser aware of my extension?

Thank you :slight_smile:

Hi @ludoc,

the camunda namespace is announced in the bpmn:definitions element:

<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0ekmb76" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.10.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.19.0">

Hope this helps, Ingo

You need to wrap all your custom elements in extension elements in the BPMN XML, otherwise you are violating the BPMN XML schema. Have a look at what Camunda produces when you add Camunda-specific configuration, for example an input/output mapping.

Thanks for your replies @Ingo_Richtsmeier and @thorben !
So if I understand you correctly it is not possible to introduce a new Event Type (e.g. Location Event) into Camunda?

Correct, BPMN has a fixed set of event types.

1 Like