@bpmn-io/execution-platform

Add execution platform meta-data to BPMN diagrams

Usage no npm install needed!

<script type="module">
  import bpmnIoExecutionPlatform from 'https://cdn.skypack.dev/@bpmn-io/execution-platform';
</script>

README

@bpmn-io/execution-platform

CI

Set executionPlatform and executionPlatformVersion in your BPMN diagrams.

Usage

import BpmnModeler from 'bpmn-js/lib/Modeler';

import ExecutionPlatformModule from '@bpmn-io/execution-platform';
import ModelerModdleExtension from 'modeler-moddle/resources/modeler.json';


// extend the BPMN editor with the module and moddle extension
var modeler = new BpmnModeler({
  additionalModules: [
    ExecutionPlatformModule
  ],
  moddleExtensions: {
    modeler: ModelerModdleExtension
  }
});

var executionPlatformHelper = modeler.get('executionPlatform');

executionPlatformHelper.setExecutionPlatform({ name: 'Camunda Cloud', version: '1.3.0' });

var executionPlatform = executionPlatformHelper.getExecutionPlatform();

// { name: 'Camunda Cloud', version: '1.3.0' }
console.log(executionPlatform);

// see the meta-data appear on save
modeler.saveXML(function(err, xml) {

  xml; // ... <bpmn:Definitions ... modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="1.3.0">...
});

You can also configure the extension so that the execution platform details are set imperatively each time you save the diagram:

import BpmnModeler from 'bpmn-js/lib/Modeler';

import ExecutionPlatformModule from '@bpmn-io/execution-platform';
import ModelerModdleExtension from 'modeler-moddle/resources/modeler.json';

// extend the BPMN editor with the module and moddle extension together with configuration
var modeler = new BpmnModeler({
  additionalModules: [
    ExecutionPlatformModule
  ],
  moddleExtensions: {
    modeler: ModelerModdleExtension
  },
  executionPlatform: {
    name: 'Camunda Cloud',
    version: '1.3.0'
  }
});

// see the meta-data appear on save
modeler.saveXML(function(err, xml) {

  xml; // ... <bpmn:Definitions ... modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="1.3.0">...
});

License

MIT