Hello,
I am working with bpmn-js.
I have a Modeler instance named ‘bpmnJs’ which was created with the modeler-moddle as moddleExtensions parameter.
I would now like to set the ‘modeler:executionPlatform’ attribute which is part of the ‘bpmn:definitions’ XML tag.
I can create a new definitions tag by calling:
bpmnJs.get("moddle").create("bpmn:Definitions", {
"modeler:executionPlatform": "Camunda Platform",
"modeler:executionPlatformVersion": "7.15.0"
});
But what I would like to do is edit the existing definitions tag and add the ‘modeler:executionPlatform’ attribute. I can of course set it by hand using
bpmnJs.getDefinitions().set('modeler:executionPlatform', 'Camunda Platform')
but then I am missing the modeler namespace and did not make any use of modeler-moddle. I could add the namespace by hand as well, but this does not seem to be the right way to do it.
I guess what my question is:
From an existing BPMN XML missing the modeler namespace and the ‘modeler:executionPlatform’ attribute, how can I add and edit it using bpmn-js and modeler-moddle?
My goal is this:
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" targetNamespace="http://bpmn.io/schema/bpmn" xmlns:modeler="http://camunda.org/schema/modeler/1.0" modeler:executionPlatform="Camunda Platform">