Unknown type <bpmn:MultipleEventDefinition>

In the ReplaceOption file I added 2 elements, in JS it gives this error, who knows how to add a type?

Although I have these types in the BpmnRenderer.js file

	  {
	    label: 'Parallel Multiple Event',
	    actionName: 'replace-with-parallel-start',
	    className: 'bpmn-icon-start-event-parallel-multiple',
	    target: {
	      type: 'bpmn:StartEvent',
	      eventDefinitionType: 'bpmn:MultipleEventDefinition'
	    }
	  }

Maybe camunda doesn’t understand what replace-with-parallel-start is. In this case, where can I register the new change?

image

What error it gives?

Unknown type bpmn:MultipleEventDefinition

There is no such thing in BPMN as bpmn:MultipleEventDefinition. The Multiple Events are events with multiple Event Definitions, e.g.

<bpmn:startEvent id="StartEvent_1">
  <bpmn:timerEventDefinition id="TimerEventDefinition" />
  <bpmn:errorEventDefinition id="ErrorEventDefinition" />
</bpmn:startEvent>
1 Like

Can you check node_modules\bpmn-js\lib\draw\BpmnRenderer.js?

These types are described

That’s right, but it’s just a simplification for the sake of rendering. The BpmnRenderer does not need to know what kind of event definitions are contained within the Event, but it only needs to know that there are more than one definition.

Nevertheless, bpmn:MutlipleEventDefinition is not a valid BPMN 2.0 type.

1 Like

As far as I understand you want to be able to create events with multiple event definitions through the palette, the context pad and the replace menu. bpmn-js can already render all BPMN 2.0 elements so adding support for multiple events is a matter of adding the ability to create them. Note that there is no existing solution for maintaining multiple event definitions. bpmn-js-properties-panel only supports single event definitions.

There’s a general example of customizing all of these: https://github.com/bpmn-io/bpmn-js-examples/tree/master/custom-elements#customize-editor-controls

I’ve created a more specific example that let’s you append end events with multiple event definitions through the context pad:

28-01-_2021_14-23-41

The crucial part is:

function createMultipleEndEvent() {
  const endEvent = bpmnFactory.create("bpmn:EndEvent");

  const errorEventDefinition1 = bpmnFactory.create(
    "bpmn:ErrorEventDefinition"
  );

  const errorEventDefinition2 = bpmnFactory.create(
    "bpmn:ErrorEventDefinition"
  );

  endEvent.set("bpmn:eventDefinitions", [
    errorEventDefinition1,
    errorEventDefinition2
  ]);

  errorEventDefinition1.$parent = endEvent;
  errorEventDefinition2.$parent = endEvent;

  const shape = elementFactory.createShape({
    type: "bpmn:EndEvent",
    businessObject: endEvent
  });

  return shape;
}

CodeSandbox: https://codesandbox.io/s/multiple-event-example-zy3pt

1 Like

@ philippfromme May be you have some good plugin example that can be used for the Desktop version of Camunda?

We have quite a few examples of Camunda Modeler plugins here: https://github.com/camunda/camunda-modeler-plugins

1 Like

@barmac Could you please give me all this EventDefinitions?

Certainly! Here you are.

1 Like