You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 14, 2024. It is now read-only.
As of version 5.0.0 this library exposes ES modules. Use esm to consume it or an ES module aware bundler such as Webpack or Rollup to bundle it for the browser.
cmmn-moddle
Read and write CMMN 1.1 diagram files in NodeJS and the browser.
cmmn-moddle uses the CMMN 1.1 meta-model to validate the input and produce correct CMMN 1.1 XML. The library is built on top of moddle and moddle-xml.
importCmmnModdlefrom'cmmn-moddle';varmoddle=newCmmnModdle();varxmlStr='<?xml version="1.0" encoding="UTF-8"?>'+'<cmmn:definitions xmlns:cmmn="https://www.omg.org/spec/CMMN/20150516/MODEL" id="empty-definitions" targetNamespace="https://bpmn.io/schema/cmmn">'+'</cmmn:definitions>';moddle.fromXML(xmlStr,function(err,definitions){// update id attributedefinitions.set('id','NEW ID');// add a root elementvarcmmnCase=moddle.create('cmmn:Case',{id: 'MyCase_1'});definitions.get('cases').push(cmmnCase);moddle.toXML(definitions,function(err,xmlStrUpdated){// xmlStrUpdated contains new id and the added process});});