bpmn-js-headless

0.1.0 • Public • Published

bpmn-js-headless

CI

Run bpmn-js in headless environments.

Usage

Use just like bpmn-js, but be sure not to use interactive (extension) modules.

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

const modeler = new BpmnModeler();

// import diagram
await modeler.importXML(myDiagram);

// perform a change operation
modeler.invoke((modeling, elementRegistry) => {

  const participant = elementRegistry.get('Participant_1');

  modeling.removeElements([ participant ]);
});

// export diagram
const {
  xml
} = await modeler.saveXML({ format: true });

Why?

This utility is useful whenever you want to apply complex modeling operations in headless (aka no browser) environments. Some examples:

How does it work

  • Uses only bpmn-js modules that are safe for headless execution
  • Overrides core diagram-js components to be independent of graphical representation

Caveats

This is a truely headless version of bpmn-js, i.e. it does not fake a browser environment. For extensions to be compatible they shall enforce a proper UI / behavior separation, and not rely on browser features.

You want to bundle this library along with extensions, as bpmn-js and dependent libraries require bundling, too.

Readme

Keywords

none

Package Sidebar

Install

npm i bpmn-js-headless

Weekly Downloads

510

Version

0.1.0

License

none

Unpacked Size

3.13 MB

Total Files

5

Last publish

Collaborators

  • nikku