bpmn-io / bpmn-js-differ Goto Github PK
View Code? Open in Web Editor NEWA diffing utility for BPMN 2.0 documents.
A diffing utility for BPMN 2.0 documents.
Hi!
I am trying to compare two Camunda BPMN files using
http://demo.bpmn.io/diff
But it throws an exception:
TypeError: element.$instanceOf is not a function when trying to diff input parameters.
in change-handler.js
at
function isTracked(element) {
return element.$instanceOf('bpmn:FlowElement') ||
element.$instanceOf('bpmn:MessageFlow') ||
element.$instanceOf('bpmn:Participant') ||
element.$instanceOf('bpmn:Lane');
}
The element $type is camunda:inputOutput.
First XML:
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="fff" isExecutable="false">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1l2alrr</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_1l2alrr" sourceRef="StartEvent_1" targetRef="Task_0geagms" />
<bpmn:scriptTask id="Task_0geagms" name="script" scriptFormat="Groovy">
<bpmn:incoming>SequenceFlow_1l2alrr</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0qh2ryo</bpmn:outgoing>
<bpmn:script>def a = 5;</bpmn:script>
</bpmn:scriptTask>
<bpmn:exclusiveGateway id="ExclusiveGateway_0i9etvt">
<bpmn:incoming>SequenceFlow_0qh2ryo</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_002h4dw</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_1skof2e</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_0qh2ryo" sourceRef="Task_0geagms" targetRef="ExclusiveGateway_0i9etvt" />
<bpmn:sequenceFlow id="SequenceFlow_002h4dw" sourceRef="ExclusiveGateway_0i9etvt" targetRef="Task_0hkdh1z" />
<bpmn:sequenceFlow id="SequenceFlow_1skof2e" sourceRef="ExclusiveGateway_0i9etvt" targetRef="Task_18gmnrc" />
<bpmn:exclusiveGateway id="ExclusiveGateway_045dd9c">
<bpmn:incoming>SequenceFlow_172rbr7</bpmn:incoming>
<bpmn:incoming>SequenceFlow_198g0r8</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1pf4zxa</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_172rbr7" sourceRef="Task_0hkdh1z" targetRef="ExclusiveGateway_045dd9c" />
<bpmn:sequenceFlow id="SequenceFlow_198g0r8" sourceRef="Task_18gmnrc" targetRef="ExclusiveGateway_045dd9c" />
<bpmn:endEvent id="EndEvent_0lgticq">
<bpmn:incoming>SequenceFlow_0xlsm8m</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_1pf4zxa" sourceRef="ExclusiveGateway_045dd9c" targetRef="Task_1t96lfx" />
<bpmn:businessRuleTask id="Task_0hkdh1z" name="dmn" camunda:decisionRef="abrakaDmn">
<bpmn:incoming>SequenceFlow_002h4dw</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_172rbr7</bpmn:outgoing>
</bpmn:businessRuleTask>
<bpmn:serviceTask id="Task_18gmnrc" name="blacklistService" camunda:delegateExpression="${syncRestService}">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="abraka" />
<camunda:inputParameter name="dabra" />
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_1skof2e</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_198g0r8</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:task id="Task_1t96lfx" name="delete">
<bpmn:incoming>SequenceFlow_1pf4zxa</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0xlsm8m</bpmn:outgoing>
</bpmn:task>
<bpmn:sequenceFlow id="SequenceFlow_0xlsm8m" sourceRef="Task_1t96lfx" targetRef="EndEvent_0lgticq" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="fff">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="173" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1l2alrr_di" bpmnElement="SequenceFlow_1l2alrr">
<di:waypoint xsi:type="dc:Point" x="209" y="120" />
<di:waypoint xsi:type="dc:Point" x="293" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="251" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1j64jmy_di" bpmnElement="Task_0geagms">
<dc:Bounds x="293" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_0i9etvt_di" bpmnElement="ExclusiveGateway_0i9etvt" isMarkerVisible="true">
<dc:Bounds x="482" y="95" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="507" y="145" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0qh2ryo_di" bpmnElement="SequenceFlow_0qh2ryo">
<di:waypoint xsi:type="dc:Point" x="393" y="120" />
<di:waypoint xsi:type="dc:Point" x="482" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="438" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_002h4dw_di" bpmnElement="SequenceFlow_002h4dw">
<di:waypoint xsi:type="dc:Point" x="507" y="145" />
<di:waypoint xsi:type="dc:Point" x="507" y="228" />
<di:waypoint xsi:type="dc:Point" x="583" y="228" />
<bpmndi:BPMNLabel>
<dc:Bounds x="522" y="186.5" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1skof2e_di" bpmnElement="SequenceFlow_1skof2e">
<di:waypoint xsi:type="dc:Point" x="507" y="95" />
<di:waypoint xsi:type="dc:Point" x="507" y="14" />
<di:waypoint xsi:type="dc:Point" x="583" y="14" />
<bpmndi:BPMNLabel>
<dc:Bounds x="522" y="54.5" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_045dd9c_di" bpmnElement="ExclusiveGateway_045dd9c" isMarkerVisible="true">
<dc:Bounds x="737" y="95" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="762" y="145" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_172rbr7_di" bpmnElement="SequenceFlow_172rbr7">
<di:waypoint xsi:type="dc:Point" x="683" y="228" />
<di:waypoint xsi:type="dc:Point" x="762" y="228" />
<di:waypoint xsi:type="dc:Point" x="762" y="145" />
<bpmndi:BPMNLabel>
<dc:Bounds x="723" y="213" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_198g0r8_di" bpmnElement="SequenceFlow_198g0r8">
<di:waypoint xsi:type="dc:Point" x="683" y="14" />
<di:waypoint xsi:type="dc:Point" x="762" y="14" />
<di:waypoint xsi:type="dc:Point" x="762" y="95" />
<bpmndi:BPMNLabel>
<dc:Bounds x="723" y="-1" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_0lgticq_di" bpmnElement="EndEvent_0lgticq">
<dc:Bounds x="1005" y="102" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1023" y="138" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1pf4zxa_di" bpmnElement="SequenceFlow_1pf4zxa">
<di:waypoint xsi:type="dc:Point" x="787" y="120" />
<di:waypoint xsi:type="dc:Point" x="847" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="817" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="BusinessRuleTask_1v6ifyn_di" bpmnElement="Task_0hkdh1z">
<dc:Bounds x="583" y="188" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0nxju3n_di" bpmnElement="Task_18gmnrc">
<dc:Bounds x="583" y="-26" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_1t96lfx_di" bpmnElement="Task_1t96lfx">
<dc:Bounds x="847" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0xlsm8m_di" bpmnElement="SequenceFlow_0xlsm8m">
<di:waypoint xsi:type="dc:Point" x="947" y="120" />
<di:waypoint xsi:type="dc:Point" x="1005" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="976" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Second XML:
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="fff" isExecutable="false">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1l2alrr</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_1l2alrr" sourceRef="StartEvent_1" targetRef="Task_0geagms" />
<bpmn:scriptTask id="Task_0geagms" name="script" scriptFormat="Groovy">
<bpmn:incoming>SequenceFlow_1l2alrr</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0qh2ryo</bpmn:outgoing>
<bpmn:script><![CDATA[def a = 5;
for(def i = 1 ; i <= 20; i++) {
def nn = 87;
}]]></bpmn:script>
</bpmn:scriptTask>
<bpmn:exclusiveGateway id="ExclusiveGateway_0i9etvt">
<bpmn:incoming>SequenceFlow_0qh2ryo</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_002h4dw</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_1skof2e</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_0qh2ryo" sourceRef="Task_0geagms" targetRef="ExclusiveGateway_0i9etvt" />
<bpmn:sequenceFlow id="SequenceFlow_002h4dw" sourceRef="ExclusiveGateway_0i9etvt" targetRef="Task_0hkdh1z" />
<bpmn:sequenceFlow id="SequenceFlow_1skof2e" sourceRef="ExclusiveGateway_0i9etvt" targetRef="Task_18gmnrc" />
<bpmn:exclusiveGateway id="ExclusiveGateway_045dd9c">
<bpmn:incoming>SequenceFlow_172rbr7</bpmn:incoming>
<bpmn:incoming>SequenceFlow_198g0r8</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1pf4zxa</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_172rbr7" sourceRef="Task_0hkdh1z" targetRef="ExclusiveGateway_045dd9c" />
<bpmn:sequenceFlow id="SequenceFlow_198g0r8" sourceRef="Task_18gmnrc" targetRef="ExclusiveGateway_045dd9c" />
<bpmn:endEvent id="EndEvent_0lgticq">
<bpmn:incoming>SequenceFlow_1pf4zxa</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_1pf4zxa" sourceRef="ExclusiveGateway_045dd9c" targetRef="EndEvent_0lgticq" />
<bpmn:businessRuleTask id="Task_0hkdh1z" name="dmn" camunda:decisionRef="abraka88Dmn">
<bpmn:incoming>SequenceFlow_002h4dw</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_172rbr7</bpmn:outgoing>
</bpmn:businessRuleTask>
<bpmn:serviceTask id="Task_18gmnrc" name="somethingService" camunda:delegateExpression="${syncRestService}">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="apple" />
<camunda:inputParameter name="melon" />
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_1skof2e</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_198g0r8</bpmn:outgoing>
</bpmn:serviceTask>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="fff">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="173" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1l2alrr_di" bpmnElement="SequenceFlow_1l2alrr">
<di:waypoint xsi:type="dc:Point" x="209" y="120" />
<di:waypoint xsi:type="dc:Point" x="293" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="251" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1j64jmy_di" bpmnElement="Task_0geagms">
<dc:Bounds x="293" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_0i9etvt_di" bpmnElement="ExclusiveGateway_0i9etvt" isMarkerVisible="true">
<dc:Bounds x="482" y="95" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="507" y="145" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0qh2ryo_di" bpmnElement="SequenceFlow_0qh2ryo">
<di:waypoint xsi:type="dc:Point" x="393" y="120" />
<di:waypoint xsi:type="dc:Point" x="482" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="438" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_002h4dw_di" bpmnElement="SequenceFlow_002h4dw">
<di:waypoint xsi:type="dc:Point" x="507" y="145" />
<di:waypoint xsi:type="dc:Point" x="507" y="228" />
<di:waypoint xsi:type="dc:Point" x="583" y="228" />
<bpmndi:BPMNLabel>
<dc:Bounds x="522" y="186.5" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1skof2e_di" bpmnElement="SequenceFlow_1skof2e">
<di:waypoint xsi:type="dc:Point" x="507" y="95" />
<di:waypoint xsi:type="dc:Point" x="507" y="14" />
<di:waypoint xsi:type="dc:Point" x="583" y="14" />
<bpmndi:BPMNLabel>
<dc:Bounds x="522" y="54.5" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_045dd9c_di" bpmnElement="ExclusiveGateway_045dd9c" isMarkerVisible="true">
<dc:Bounds x="737" y="95" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="762" y="145" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_172rbr7_di" bpmnElement="SequenceFlow_172rbr7">
<di:waypoint xsi:type="dc:Point" x="683" y="228" />
<di:waypoint xsi:type="dc:Point" x="762" y="228" />
<di:waypoint xsi:type="dc:Point" x="762" y="145" />
<bpmndi:BPMNLabel>
<dc:Bounds x="723" y="213" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_198g0r8_di" bpmnElement="SequenceFlow_198g0r8">
<di:waypoint xsi:type="dc:Point" x="683" y="14" />
<di:waypoint xsi:type="dc:Point" x="762" y="14" />
<di:waypoint xsi:type="dc:Point" x="762" y="95" />
<bpmndi:BPMNLabel>
<dc:Bounds x="723" y="-1" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_0lgticq_di" bpmnElement="EndEvent_0lgticq">
<dc:Bounds x="900" y="102" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="918" y="138" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1pf4zxa_di" bpmnElement="SequenceFlow_1pf4zxa">
<di:waypoint xsi:type="dc:Point" x="787" y="120" />
<di:waypoint xsi:type="dc:Point" x="900" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="844" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="BusinessRuleTask_1v6ifyn_di" bpmnElement="Task_0hkdh1z">
<dc:Bounds x="583" y="188" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0nxju3n_di" bpmnElement="Task_18gmnrc">
<dc:Bounds x="583" y="-26" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Hi!
The differ cannot find camunda:decisionRef changes.
Can it be that differ not works in case of camunda namespace?
Newer Versions of moddle-xml (v. 7.0.0 onwards) support loading of XMLs using the Java Script promise structure. The documentation of the bpmn-js-differ on how to import xml should reflect that.
The readme part on "Reading BPMN 2.0 documents" could e.g. be updated to something along the following lines:
Load diagrams using bpmn-moddle:
import BpmnModdle from 'bpmn-moddle';
var oldDefinitions, newDefinitions
try{
oldDefinitions = (await new BpmnModdle().fromXML(a)).rootElement;
newDefinitions = (await new BpmnModdle().fromXML(b)).rootElement;
} catch(err){
console.log('something went wrong', err);
}
https://demo.bpmn.io/diff is not working now.
Site is working and show diff
I have a simple BPMN diagram where a new service was added. The edge going from A to End is now an edge from A to B. It is wrongly classified as a layoutchange only whereas it is a semantical change:
The JSON diff is this:
{
"_layoutChanged": {
"Flow_0dhn14f": {
"$type": "bpmn:SequenceFlow",
"id": "Flow_0dhn14f"
}
},
"_changed": {},
"_removed": {},
"_added": {
"Activity_0d0duli": {
"$type": "bpmn:Task",
"id": "Activity_0d0duli",
"name": "B"
},
"Flow_19qppgm": {
"$type": "bpmn:SequenceFlow",
"id": "Flow_19qppgm"
}
}
}
Exepected would have been for it to go into the "changed" section.
I used the only version of https://demo.bpmn.io/diff as well as running locally with "bpmn-js-differ": "2.0.2".
SequenceFlow element type toggling (eg.: Sequence flow -> Default flow) is not recognized as a change.
Label change works fine.
_changed property of diff function result should contain something similar:
_changed : {
Gateway_id: {
attrs: {
default: {
oldValue: undefined,
newValue: 'Flow_id'
}
}
}
}
Object model contains this default attribute:
modeler._definitions.rootElements[0].flowElements.find(f => f.id == 'Gateway_id').default
ModdleElement {id: 'Flow_id', name: 'default', $parent: ModdleElement, …}
$type: "bpmn:SequenceFlow"
id: "Flow_id"
name: "default"
$attrs: (...)
// ...
Library version: 2.0.2
Describe the Bug
When we compare two models, and there is a difference in the "duration" configuration in the timer event, then bpmn-js-differ neither populate in the "list of changes" section nor show it on the difference on the models.
Steps to Reproduce
Expected Behavior
Environment
The diff of sub-processes does not work as intended, only one pane enters the sub-process. Additionally it's not possible to come out of a sub-process.
We should be able to navigate back to the parent.
Hi guys,
we are using the bpmn-js-differ lib and experience warnings since we refactored our project to use webpack. Webpack warns us, that the library jsondiffpatch has got a critical dependency in its code because the request of an internal dependency is an expression:
WARNING in ./node_modules/jsondiffpatch/src/main.js
56:20-50 Critical dependency: the request of a dependency is an expression
@ ./node_modules/jsondiffpatch/src/main.js
@ ./node_modules/bpmn-js-differ/lib/differ.js
@ ./node_modules/bpmn-js-differ/index.js
WARNING in ./node_modules/jsondiffpatch/src/main.js
61:19-47 Critical dependency: the request of a dependency is an expression
@ ./node_modules/jsondiffpatch/src/main.js
@ ./node_modules/bpmn-js-differ/lib/differ.js
@ ./node_modules/bpmn-js-differ/index.js
The parts in the code of jsondiffpatch are the following (jsondiffpatch/src/main.js):
...
if (environment.isBrowser) {
exports.homepage = '{{package-homepage}}';
exports.version = '{{package-version}}';
} else {
var packageInfoModuleName = '../package.json';
var packageInfo = require(packageInfoModuleName);
exports.homepage = packageInfo.homepage;
exports.version = packageInfo.version;
var formatterModuleName = './formatters';
var formatters = require(formatterModuleName);
exports.formatters = formatters;
// shortcut for console
exports.console = formatters.console;
}
...
So i checked which version of jsondiffpatch you are using in the bpmn-js-differ lib (>> version 0.2.5). In the newest version of jsondiffpatch (0.3.9), this part of code is refactored.
We would be very thankful, if you could update the bpmn-js-differ dependencies to jsondiffpatch version 0.3.9!
Trace from the diff demo:
Uncaught Error: functions are not supported
at trivialMatchesDiffFilter (app.js:18419)
at Pipe.process (app.js:18601)
at Processor.process (app.js:18763)
at DiffPatcher.diff (app.js:17537)
at Differ.createDiff (app.js:484)
at Differ.diff (app.js:529)
at Function.module.exports.diff (app.js:537)
at showDiff (app.js:145)
at diagramLoaded (app.js:117)
at done (app.js:129)
Test Diagrams
The diff
Method returns the same results, when comparing two models, that are exactly the same and two completely different models with different collaborations.
Consider the following two process definitions:
process1
process2
When calling the diff()
method on both of these processes, I would not expect a result that looks like, both processes are the same (or that there are no changes).
The current behavior makes it very hard to distinguish, if two compared processes are the same or if these are actually complete different processes.
I notice that the https://demo.bpmn.io/diff site uses this ... in fact it is a very small wrapper around it along with some CSS.
Is the code available somewhere? If I were to use the code from that site as a starting point for something else then the licence is not clear. Would you be willing to clarify it please?
Timer Event differences are not being shown as output from this framework.
Please create clones BPMNs with timer event with default event duration as PT1S, and change the timer event's duration to PT5S on one of the BPMN File.
Now upload both the files to see the list of
diagram_1.zip
changes and the frame work wouldn't really differenciate on the files.
The differ returns bpmn:DataObject
instances when it actually should return drawable elements (the referenced bpmn:DataObjectReference
instead.
Context
Diffing demo stack trace:
Uncaught TypeError: Cannot read property 'id' of undefined
at Canvas._updateMarker (app.js:8785)
at Canvas.addMarker (app.js:8832)
at highlight (app.js:301)
at ModdleElement.<anonymous> (app.js:153)
at Function.each (app.js:29160)
at showDiff (app.js:152)
at diagramLoaded (app.js:117)
at done (app.js:129)
at app.js:724
at importBpmnDiagram (app.js:4196)
Test Diagrams
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.