bpmn-moddle
A moddle wrapper for BPMN 2.0
Last updated 7 years ago by nikku .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install bpmn-moddle 
SYNC missed versions from official npm registry.

bpmn-moddle

CI

Read and write BPMN 2.0 diagram files in NodeJS and the browser.

bpmn-moddle uses the BPMN 2.0 meta-model to validate the input and produce correct BPMN 2.0 XML.

Usage

Get the library via npm package. Consume it in NodeJS, via UMD or bundle it using your favorite build tool.

import BpmnModdle from 'bpmn-moddle';

const moddle = new BpmnModdle();

const xmlStr =
  '<?xml version="1.0" encoding="UTF-8"?>' +
  '<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
                     'id="empty-definitions" ' +
                     'targetNamespace="http://bpmn.io/schema/bpmn">' +
  '</bpmn2:definitions>';


const {
  rootElement: definitions
} = await moddle.fromXML(xmlStr);

// update id attribute
definitions.set('id', 'NEW ID');

// add a root element
const bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });
definitions.get('rootElements').push(bpmnProcess);

// xmlStrUpdated contains new id and the added process
const {
  xml: xmlStrUpdated
} = await moddle.toXML(definitions);

Resources

Building the Project

The tests include XSD schema validation. They required you to have a Java SDK installed and exposed through the JAVA_HOME variable.

# execute the test
npm test

# perform a full build
npm run all

Related

The library is built on top of moddle and moddle-xml.

License

Use under the terms of the MIT license.

Current Tags

  • 8.0.1                                ...           latest (2 years ago)

79 Versions

  • 7.0.5                                ...           4 years ago
  • 0.10.2                                ...           9 years ago
  • 8.0.1                                ...           2 years ago
  • 8.0.0                                ...           2 years ago
  • 7.1.3                                ...           2 years ago
  • 7.1.2                                ...           3 years ago
  • 7.1.1                                ...           4 years ago
  • 7.1.0                                ...           4 years ago
  • 7.0.4                                ...           4 years ago
  • 7.0.3                                ...           5 years ago
  • 6.0.7                                ...           5 years ago
  • 7.0.2                                ...           5 years ago
  • 6.0.6                                ...           5 years ago
  • 6.0.5                                ...           5 years ago
  • 7.0.1                                ...           5 years ago
  • 7.0.0                                ...           5 years ago
  • 6.0.4                                ...           5 years ago
  • 6.0.3                                ...           5 years ago
  • 6.0.2                                ...           5 years ago
  • 6.0.1                                ...           5 years ago
  • 6.0.0                                ...           5 years ago
  • 5.2.0                                ...           5 years ago
  • 5.1.6                                ...           6 years ago
  • 5.1.5                                ...           7 years ago
  • 5.1.4                                ...           7 years ago
  • 5.1.3                                ...           7 years ago
  • 5.1.2                                ...           7 years ago
  • 5.1.1                                ...           7 years ago
  • 5.1.0                                ...           7 years ago
  • 5.0.1                                ...           7 years ago
  • 5.0.0                                ...           7 years ago
  • 4.0.0                                ...           7 years ago
  • 3.0.2                                ...           7 years ago
  • 3.0.1                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 2.1.2                                ...           7 years ago
  • 2.1.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.15.0                                ...           7 years ago
  • 0.14.1                                ...           7 years ago
  • 0.14.0                                ...           8 years ago
  • 0.13.0                                ...           8 years ago
  • 0.12.4                                ...           8 years ago
  • 0.12.3                                ...           8 years ago
  • 0.12.2                                ...           8 years ago
  • 0.12.1                                ...           9 years ago
  • 0.12.0                                ...           9 years ago
  • 0.11.0                                ...           9 years ago
  • 0.10.4                                ...           9 years ago
  • 0.10.3                                ...           9 years ago
  • 0.10.1                                ...           9 years ago
  • 0.10.0                                ...           9 years ago
  • 0.9.3                                ...           9 years ago
  • 0.9.2                                ...           9 years ago
  • 0.9.1                                ...           9 years ago
  • 0.9.0                                ...           9 years ago
  • 0.8.3                                ...           10 years ago
  • 0.8.2                                ...           10 years ago
  • 0.8.1                                ...           10 years ago
  • 0.8.0                                ...           10 years ago
  • 0.7.0                                ...           10 years ago
  • 0.6.0                                ...           10 years ago
  • 0.5.0                                ...           10 years ago
  • 0.4.1                                ...           10 years ago
  • 0.4.0                                ...           10 years ago
  • 0.3.1                                ...           10 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
  • 0.0.1                                ...           11 years ago
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |