bpmn-js-differ

A semantic diffing utility for BPMN 2.0 files. To be used together with bpmn-moddle.
Usage
Get the project via npm:
npm install --save bpmn-js-differ
Use the differ to compare two BPMN 2.0 documents:
import { diff } from 'bpmn-js-differ';
var oldDefinitions, newDefinitions;
var changes = diff(oldDefinitions, newDefinitions);
The diff returns an object with the _changed, _added, _removed, _layoutChanged keys containing all differences between the models.
console.log(changes._changed);
console.log(changes._removed);
console.log(changes._layoutChanged);
console.log(changes._added);
Reading BPMN 2.0 documents
Get bpmn-moddle via npm:
npm install --save bpmn-moddle
Load a diagram definition:
import BpmnModdle from 'bpmn-moddle';
async function loadModel(diagramXML) {
const bpmnModdle = new BpmnModdle();
const { rootElement: definitionsA } = await bpmnModdle.fromXML(diagramXML),
return rootElement;
}
const definitionsA = await loadModel(aXML);
Visual Diffing
Use bpmn-js along with element coloring to build your visual diff tool on top of this utility.
License
MIT