How to add Element templates to bpmn-js bower bundle?


#1

I have bower package where i am trying to add Element template please provide some example how we can get element templates working in bower bpmn-js bundle.

client

var bpmnModeler = new BpmnViewer({
      container: '#canvas',
      propertiesPanel:{
        parent: '#js-properties-panel'
      }
    });

bower

var camundaModdleDescriptor = require('camunda-bpmn-moddle/resources/camunda');

var additionalModules = [
  require('bpmn-js-properties-panel'),

  // 1. require camunda provider instead of the bpmn one (!)
  require('bpmn-js-properties-panel/lib/provider/camunda')
];

BpmnViewer.prototype._modules = BpmnViewer.prototype._modules.concat(additionalModules);

// 2. include camunda moddle descriptor
BpmnViewer.prototype._moddleExtensions = { camunda: camundaModdleDescriptor }

module.exports = BpmnViewer;

#2

Element templates won’t work out of the box due to the missing properties panel in the pre-packaged bower bundle.

You need to create a bundle yourself, using the BpmnModeler and the Properties Panel. C.f. this thread for more a more detailed example.


How to render Element templates in properties panel?