Git Product home page Git Product logo

bpmn-js-differ's People

Contributors

barmac avatar chrisschoe avatar maxstroh avatar nikku avatar robpal94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bpmn-js-differ's Issues

Exception in case of input / output parameters

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>

Update documentation to be compatible with newer versions of moddle-xml

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);
    }

Edge is wrongly classified as layoutChange

Describe the Bug

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:

image

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"
		}
	}
}

Steps to Reproduce

  1. Create simple flow with Start -> A -> End.
  2. Save this as version 1
  3. Drag a new service on the edge between A and End.
  4. Save this as version 2
  5. Import version 1 and version 2 into https://demo.bpmn.io/diff

Expected Behavior

Exepected would have been for it to go into the "changed" section.

Environment

I used the only version of https://demo.bpmn.io/diff as well as running locally with "bpmn-js-differ": "2.0.2".

SequenceFlow type change is not recognized

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

Timer Event is not recognized in the differ module

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

  1. create two BPMNs (clone each other) with timer event with default event duration as PT1S
  2. take the second BPMN file and change the above same event's duration to PT15S
  3. upload these two BPMN Files in the https://demo.bpmn.io/diff, to see if the tool can alert the timer difference.
  4. diff tool doesn't alert a difference at the timer event.

Expected Behavior

  1. Diff tool is expected to show the different between two models
  2. Tool may have to high light there is a difference in timer event node.
  3. Tool may have to list this difference in "List of changes" panel.

Environment

  • Host (Browser/Node version: Version 105.0.5195.125 (Official Build) (64-bit)
  • OS: [e.g. Windows 7]: Windows 11
  • Library version: [e.g. 2.0.0]

Sample BPMN Files.zip

Can't return to parent process from sub-process

Describe the Bug

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.

Steps to Reproduce

  1. Diff a process that contains a collapsed sub-process element
  2. Click on the arrow to enter that sub-process
  3. => It's not possible to come back to the parent

Expected Behavior

We should be able to navigate back to the parent.

Update jsondiffpatch-Library

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!

Diff failing with embedded camunda:executionListener

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

Diff method did not find changes on two completely different process definitions

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.

demo licence

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 difference is not recognized.

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.

Diff failing with bpmn:DataObjects

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.