Adding Camunda moddle

Hi, I added Camunda moddle like this,

global.BpmnEditor = require('bpmn-js/lib/Modeler');
global.camundaExtensionModule = require('camunda-bpmn-moddle/lib');

....
            editor.bpmn = new BpmnEditor({
                container: '#bpmn-editor-canvas',
                additionalModules: [
                    { contextPadProvider: ['type', MyPropertiesContextPadProvider]},
                    camundaExtensionModule
                ]
            });

But the xml created does not contain the camunda namespace.

Iā€™ve seen this

but find this method a bit confusing in my caseā€¦ for example, I donā€™t have extensionModel object. How do I provide the camunda namespace with what I have - the Modeler class and the Moddle? Probably override the ā€˜initialDiagramā€™ from https://github.com/bpmn-io/bpmn-js/blob/master/lib/Modeler.js somehow?

Youā€™re missing the model extension:

var BpmnJS = require('bpmn-js/lib/Modeler'),
    camundaExtensionModule = require('camunda-bpmn-moddle/lib'),
    camundaModdle = require('camunda-bpmn-moddle/resources/camunda');

var modeler = new BpmnJS({
    additionalModules: [
      camundaExtensionModule
    ],
    moddleExtensions: {
      camunda: camundaModdle
    }
});

Refer to this example or the camunda-bpmn-moddle README for more details.

3 Likes

thanks, sorry, missed it. works ok