Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bpmn-moddle

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpmn-moddle

A moddle wrapper for BPMN 2.0

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42K
decreased by-45.03%
Maintainers
2
Weekly downloads
 
Created
Source

bpmn-moddle

bpmn-moddle allows you to read and write BPMN 2.0 diagram files in NodeJS and the browser. It uses the BPMN 2.0 meta-model to validate the input and produce correct BPMN 2.0 XML.

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

Usage

The library is provided as an npm package. Bundle it for the web via browserify.

var Bpmn = require('bpmn-moddle');

var 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>';


Bpmn.fromXML(xmlStr, function(err, definitions) {

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

  var model = Bpmn.instance();

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

  Bpmn.toXML(definitions, function(err, xmlStrUpdated) {

    // xmlStrUpdated contains new id and the added process

  });

});

Resources

Building the Project

You need grunt to build the project.

To run the test suite that includes XSD schema validation you must have a Java JDK installed and properly exposed through the JAVA_HOME variable.

Execute the test via

grunt test

Perform a complete build of the application via

grunt

License

Use under the terms of the MIT license.

Keywords

FAQs

Package last updated on 19 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc