Skip to content

Commit e2bc513

Browse files
pmeyer-viadeenikku
authored andcommitted
fix(inclusive-gateway-settings): do not color flows during simulation toggle
Closes #242
1 parent 5a17269 commit e2bc513

File tree

3 files changed

+205
-1
lines changed

3 files changed

+205
-1
lines changed

lib/features/inclusive-gateway-settings/InclusiveGatewaySettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ InclusiveGatewaySettings.prototype._setGatewayDefaults = function(gateway) {
121121
};
122122

123123
InclusiveGatewaySettings.prototype._resetGateway = function(gateway) {
124-
this._setActiveOutgoing(gateway, undefined);
124+
this._simulator.setConfig(gateway, { activeOutgoing: undefined });
125125
};
126126

127127
InclusiveGatewaySettings.$inject = [
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import ModelerModule from 'lib/modeler';
2+
3+
import SimulationSupportModule from 'lib/simulation-support';
4+
5+
import {
6+
bootstrapModeler,
7+
inject
8+
} from 'test/TestHelper';
9+
10+
import { expect } from 'chai';
11+
12+
13+
const TestModule = {
14+
__depends__: [
15+
SimulationSupportModule
16+
]
17+
};
18+
19+
20+
describe('features/gateway-settings', function() {
21+
22+
const diagramXML = require('./gateways.bpmn');
23+
24+
beforeEach(bootstrapModeler(diagramXML, {
25+
additionalModules: [
26+
ModelerModule,
27+
TestModule
28+
]
29+
}));
30+
31+
32+
it('should not change xml when toggling simulation off', inject(
33+
async function(toggleMode, bpmnjs) {
34+
35+
// given
36+
const { xml: originalXML } = await bpmnjs.saveXML({ format: true });
37+
38+
// when
39+
// simulation is toggled <ON> and <OFF>
40+
toggleMode.toggleMode();
41+
toggleMode.toggleMode();
42+
43+
// then
44+
const { xml: savedXML } = await bpmnjs.saveXML({ format: true });
45+
46+
expect(savedXML).to.eql(originalXML);
47+
48+
}
49+
));
50+
51+
});
52+
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="bpmn-js-token-simulation" exporterVersion="0.38.1">
3+
<bpmn:process id="Process_1" isExecutable="true">
4+
<bpmn:startEvent id="Event_1eltpca">
5+
<bpmn:outgoing>Flow_1jj9sk5</bpmn:outgoing>
6+
</bpmn:startEvent>
7+
<bpmn:exclusiveGateway id="Gateway_0zm62x0">
8+
<bpmn:incoming>Flow_1jj9sk5</bpmn:incoming>
9+
<bpmn:outgoing>Flow_1pkspsk</bpmn:outgoing>
10+
<bpmn:outgoing>Flow_1hjl9uh</bpmn:outgoing>
11+
</bpmn:exclusiveGateway>
12+
<bpmn:sequenceFlow id="Flow_1jj9sk5" sourceRef="Event_1eltpca" targetRef="Gateway_0zm62x0" />
13+
<bpmn:sequenceFlow id="Flow_1pkspsk" sourceRef="Gateway_0zm62x0" targetRef="Gateway_16y1x5h" />
14+
<bpmn:sequenceFlow id="Flow_1hjl9uh" sourceRef="Gateway_0zm62x0" targetRef="Gateway_1e77yq3" />
15+
<bpmn:parallelGateway id="Gateway_16y1x5h">
16+
<bpmn:incoming>Flow_1pkspsk</bpmn:incoming>
17+
<bpmn:outgoing>Flow_195cpw8</bpmn:outgoing>
18+
<bpmn:outgoing>Flow_0x1jsiv</bpmn:outgoing>
19+
</bpmn:parallelGateway>
20+
<bpmn:inclusiveGateway id="Gateway_1e77yq3">
21+
<bpmn:incoming>Flow_1hjl9uh</bpmn:incoming>
22+
<bpmn:outgoing>Flow_1dx6gvk</bpmn:outgoing>
23+
<bpmn:outgoing>Flow_0vti0xb</bpmn:outgoing>
24+
</bpmn:inclusiveGateway>
25+
<bpmn:sequenceFlow id="Flow_195cpw8" sourceRef="Gateway_16y1x5h" targetRef="Gateway_1lrwgbn" />
26+
<bpmn:sequenceFlow id="Flow_0x1jsiv" sourceRef="Gateway_16y1x5h" targetRef="Gateway_1lrwgbn" />
27+
<bpmn:parallelGateway id="Gateway_1lrwgbn">
28+
<bpmn:incoming>Flow_0x1jsiv</bpmn:incoming>
29+
<bpmn:incoming>Flow_195cpw8</bpmn:incoming>
30+
<bpmn:outgoing>Flow_1gxl3lz</bpmn:outgoing>
31+
</bpmn:parallelGateway>
32+
<bpmn:sequenceFlow id="Flow_1dx6gvk" sourceRef="Gateway_1e77yq3" targetRef="Gateway_06d9rew" />
33+
<bpmn:sequenceFlow id="Flow_0vti0xb" sourceRef="Gateway_1e77yq3" targetRef="Gateway_06d9rew" />
34+
<bpmn:inclusiveGateway id="Gateway_06d9rew">
35+
<bpmn:incoming>Flow_1dx6gvk</bpmn:incoming>
36+
<bpmn:incoming>Flow_0vti0xb</bpmn:incoming>
37+
<bpmn:outgoing>Flow_0fqchl4</bpmn:outgoing>
38+
</bpmn:inclusiveGateway>
39+
<bpmn:sequenceFlow id="Flow_1gxl3lz" sourceRef="Gateway_1lrwgbn" targetRef="Gateway_1yxqhkn" />
40+
<bpmn:eventBasedGateway id="Gateway_1yxqhkn">
41+
<bpmn:incoming>Flow_1gxl3lz</bpmn:incoming>
42+
<bpmn:outgoing>Flow_0tt1bfn</bpmn:outgoing>
43+
<bpmn:outgoing>Flow_10mohu2</bpmn:outgoing>
44+
</bpmn:eventBasedGateway>
45+
<bpmn:intermediateCatchEvent id="Event_04dln5v">
46+
<bpmn:incoming>Flow_0tt1bfn</bpmn:incoming>
47+
<bpmn:messageEventDefinition id="MessageEventDefinition_0jo7wv1" />
48+
</bpmn:intermediateCatchEvent>
49+
<bpmn:sequenceFlow id="Flow_0tt1bfn" sourceRef="Gateway_1yxqhkn" targetRef="Event_04dln5v" />
50+
<bpmn:sequenceFlow id="Flow_0fqchl4" sourceRef="Gateway_06d9rew" targetRef="Event_12nxs04" />
51+
<bpmn:endEvent id="Event_12nxs04">
52+
<bpmn:incoming>Flow_0fqchl4</bpmn:incoming>
53+
</bpmn:endEvent>
54+
<bpmn:intermediateCatchEvent id="Event_009jb3y">
55+
<bpmn:incoming>Flow_10mohu2</bpmn:incoming>
56+
<bpmn:timerEventDefinition id="TimerEventDefinition_1a4qfco" />
57+
</bpmn:intermediateCatchEvent>
58+
<bpmn:sequenceFlow id="Flow_10mohu2" sourceRef="Gateway_1yxqhkn" targetRef="Event_009jb3y" />
59+
</bpmn:process>
60+
<bpmn:message id="Message_1dyo6g5" name="Message_message" />
61+
<bpmn:error id="Error_0k93fd1" name="Error_1405ero" />
62+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
63+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
64+
<bpmndi:BPMNShape id="Event_1eltpca_di" bpmnElement="Event_1eltpca">
65+
<dc:Bounds x="172" y="12" width="36" height="36" />
66+
</bpmndi:BPMNShape>
67+
<bpmndi:BPMNShape id="Gateway_0zm62x0_di" bpmnElement="Gateway_0zm62x0" isMarkerVisible="true">
68+
<dc:Bounds x="265" y="5" width="50" height="50" />
69+
</bpmndi:BPMNShape>
70+
<bpmndi:BPMNShape id="Gateway_0k34eki_di" bpmnElement="Gateway_16y1x5h">
71+
<dc:Bounds x="405" y="-125" width="50" height="50" />
72+
</bpmndi:BPMNShape>
73+
<bpmndi:BPMNShape id="Gateway_1k2bw04_di" bpmnElement="Gateway_1e77yq3">
74+
<dc:Bounds x="405" y="115" width="50" height="50" />
75+
</bpmndi:BPMNShape>
76+
<bpmndi:BPMNShape id="Gateway_1im6nb4_di" bpmnElement="Gateway_1lrwgbn">
77+
<dc:Bounds x="545" y="-125" width="50" height="50" />
78+
</bpmndi:BPMNShape>
79+
<bpmndi:BPMNShape id="Gateway_1ch9q4e_di" bpmnElement="Gateway_06d9rew">
80+
<dc:Bounds x="545" y="115" width="50" height="50" />
81+
</bpmndi:BPMNShape>
82+
<bpmndi:BPMNShape id="Event_12nxs04_di" bpmnElement="Event_12nxs04">
83+
<dc:Bounds x="652" y="122" width="36" height="36" />
84+
</bpmndi:BPMNShape>
85+
<bpmndi:BPMNShape id="Gateway_0rg8eov_di" bpmnElement="Gateway_1yxqhkn">
86+
<dc:Bounds x="665" y="-125" width="50" height="50" />
87+
</bpmndi:BPMNShape>
88+
<bpmndi:BPMNShape id="Event_04dln5v_di" bpmnElement="Event_04dln5v">
89+
<dc:Bounds x="792" y="-158" width="36" height="36" />
90+
</bpmndi:BPMNShape>
91+
<bpmndi:BPMNShape id="Event_009jb3y_di" bpmnElement="Event_009jb3y">
92+
<dc:Bounds x="792" y="-68" width="36" height="36" />
93+
</bpmndi:BPMNShape>
94+
<bpmndi:BPMNEdge id="Flow_1jj9sk5_di" bpmnElement="Flow_1jj9sk5">
95+
<di:waypoint x="208" y="30" />
96+
<di:waypoint x="265" y="30" />
97+
</bpmndi:BPMNEdge>
98+
<bpmndi:BPMNEdge id="Flow_1pkspsk_di" bpmnElement="Flow_1pkspsk">
99+
<di:waypoint x="290" y="5" />
100+
<di:waypoint x="290" y="-100" />
101+
<di:waypoint x="405" y="-100" />
102+
</bpmndi:BPMNEdge>
103+
<bpmndi:BPMNEdge id="Flow_1hjl9uh_di" bpmnElement="Flow_1hjl9uh">
104+
<di:waypoint x="290" y="55" />
105+
<di:waypoint x="290" y="140" />
106+
<di:waypoint x="405" y="140" />
107+
</bpmndi:BPMNEdge>
108+
<bpmndi:BPMNEdge id="Flow_195cpw8_di" bpmnElement="Flow_195cpw8">
109+
<di:waypoint x="430" y="-75" />
110+
<di:waypoint x="430" y="-40" />
111+
<di:waypoint x="570" y="-40" />
112+
<di:waypoint x="570" y="-75" />
113+
</bpmndi:BPMNEdge>
114+
<bpmndi:BPMNEdge id="Flow_0x1jsiv_di" bpmnElement="Flow_0x1jsiv">
115+
<di:waypoint x="430" y="-125" />
116+
<di:waypoint x="430" y="-160" />
117+
<di:waypoint x="570" y="-160" />
118+
<di:waypoint x="570" y="-125" />
119+
</bpmndi:BPMNEdge>
120+
<bpmndi:BPMNEdge id="Flow_1dx6gvk_di" bpmnElement="Flow_1dx6gvk">
121+
<di:waypoint x="430" y="165" />
122+
<di:waypoint x="430" y="200" />
123+
<di:waypoint x="570" y="200" />
124+
<di:waypoint x="570" y="165" />
125+
</bpmndi:BPMNEdge>
126+
<bpmndi:BPMNEdge id="Flow_0vti0xb_di" bpmnElement="Flow_0vti0xb">
127+
<di:waypoint x="430" y="115" />
128+
<di:waypoint x="430" y="80" />
129+
<di:waypoint x="570" y="80" />
130+
<di:waypoint x="570" y="115" />
131+
</bpmndi:BPMNEdge>
132+
<bpmndi:BPMNEdge id="Flow_1gxl3lz_di" bpmnElement="Flow_1gxl3lz">
133+
<di:waypoint x="595" y="-100" />
134+
<di:waypoint x="665" y="-100" />
135+
</bpmndi:BPMNEdge>
136+
<bpmndi:BPMNEdge id="Flow_0tt1bfn_di" bpmnElement="Flow_0tt1bfn">
137+
<di:waypoint x="690" y="-125" />
138+
<di:waypoint x="690" y="-140" />
139+
<di:waypoint x="792" y="-140" />
140+
</bpmndi:BPMNEdge>
141+
<bpmndi:BPMNEdge id="Flow_0fqchl4_di" bpmnElement="Flow_0fqchl4">
142+
<di:waypoint x="595" y="140" />
143+
<di:waypoint x="652" y="140" />
144+
</bpmndi:BPMNEdge>
145+
<bpmndi:BPMNEdge id="Flow_10mohu2_di" bpmnElement="Flow_10mohu2">
146+
<di:waypoint x="690" y="-75" />
147+
<di:waypoint x="690" y="-60" />
148+
<di:waypoint x="795" y="-60" />
149+
</bpmndi:BPMNEdge>
150+
</bpmndi:BPMNPlane>
151+
</bpmndi:BPMNDiagram>
152+
</bpmn:definitions>

0 commit comments

Comments
 (0)