Skip to content

Commit 09849aa

Browse files
committed
fix: adjust rule no-implicit-start , no-implicit-start to not throw for activities in adhoc subprocesses
Closes #180
1 parent 072559c commit 09849aa

File tree

4 files changed

+121
-34
lines changed

4 files changed

+121
-34
lines changed

rules/no-implicit-end.js

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ module.exports = function() {
6363
return false;
6464
}
6565

66+
if (is(node, 'bpmn:Activity') && is(node.$parent, 'bpmn:AdHocSubProcess')) {
67+
return false;
68+
}
69+
6670
if (is(node, 'bpmn:EndEvent')) {
6771
return false;
6872
}

rules/no-implicit-start.js

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ module.exports = function() {
2929
return false;
3030
}
3131

32+
if (is(node, 'bpmn:Activity') && is(node.$parent, 'bpmn:AdHocSubProcess')) {
33+
return false;
34+
}
35+
3236
if (is(node, 'bpmn:SubProcess') && node.triggeredByEvent) {
3337
return false;
3438
}

test/rules/no-implicit-end/valid.bpmn

+64-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="Camunda Modeler" exporterVersion="5.25.0">
2+
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="Camunda Modeler" exporterVersion="5.34.0-dev">
33
<process id="PROCESS" isExecutable="false">
44
<endEvent id="END_EVENT" name="END_EVENT">
55
<incoming>Flow_1w3680k</incoming>
@@ -57,6 +57,19 @@
5757
<incoming>Flow_044vrdf</incoming>
5858
</endEvent>
5959
<sequenceFlow id="Flow_044vrdf" sourceRef="Activity_157mlpt" targetRef="Event_109rdfb" />
60+
<startEvent id="StartEvent_AdHoc" name="START_ADHOC">
61+
<outgoing>Flow_169nah2</outgoing>
62+
</startEvent>
63+
<sequenceFlow id="Flow_169nah2" sourceRef="StartEvent_AdHoc" targetRef="Activity_0v4hh2m" />
64+
<adHocSubProcess id="Activity_0v4hh2m">
65+
<incoming>Flow_169nah2</incoming>
66+
<outgoing>Flow_1qprlnl</outgoing>
67+
<task id="Task_AdHoc" name="TASK" />
68+
</adHocSubProcess>
69+
<endEvent id="EndEvent_AdHoc" name="END_ADHOC">
70+
<incoming>Flow_1qprlnl</incoming>
71+
</endEvent>
72+
<sequenceFlow id="Flow_1qprlnl" sourceRef="Activity_0v4hh2m" targetRef="EndEvent_AdHoc" />
6073
<group id="Group_14ev8gw" />
6174
<association id="Association_1ixehz7" associationDirection="One" sourceRef="COMPENSATION_ACTIVITY_EVENT" targetRef="COMPENSATION_ACTIVITY" />
6275
</process>
@@ -102,6 +115,28 @@
102115
<omgdc:Bounds x="564" y="145" width="73" height="14" />
103116
</bpmndi:BPMNLabel>
104117
</bpmndi:BPMNShape>
118+
<bpmndi:BPMNShape id="Event_1ut5ytf_di" bpmnElement="StartEvent_AdHoc">
119+
<omgdc:Bounds x="972" y="562" width="36" height="36" />
120+
<bpmndi:BPMNLabel>
121+
<omgdc:Bounds x="951" y="605" width="81" height="14" />
122+
</bpmndi:BPMNLabel>
123+
</bpmndi:BPMNShape>
124+
<bpmndi:BPMNShape id="Event_10pi7id_di" bpmnElement="EndEvent_AdHoc">
125+
<omgdc:Bounds x="1522" y="562" width="36" height="36" />
126+
<bpmndi:BPMNLabel>
127+
<omgdc:Bounds x="1506" y="605" width="70" height="14" />
128+
</bpmndi:BPMNLabel>
129+
</bpmndi:BPMNShape>
130+
<bpmndi:BPMNShape id="Activity_0lxy7o7_di" bpmnElement="EVENT_SUB" isExpanded="true">
131+
<omgdc:Bounds x="940" y="90" width="350" height="200" />
132+
<bpmndi:BPMNLabel />
133+
</bpmndi:BPMNShape>
134+
<bpmndi:BPMNShape id="Event_1mfo1h4_di" bpmnElement="LINK_CATCH">
135+
<omgdc:Bounds x="362" y="122" width="36" height="36" />
136+
<bpmndi:BPMNLabel>
137+
<omgdc:Bounds x="346" y="98" width="68" height="14" />
138+
</bpmndi:BPMNLabel>
139+
</bpmndi:BPMNShape>
105140
<bpmndi:BPMNShape id="Activity_157mlpt_di" bpmnElement="Activity_157mlpt">
106141
<omgdc:Bounds x="630" y="540" width="100" height="80" />
107142
<bpmndi:BPMNLabel />
@@ -122,38 +157,30 @@
122157
<omgdc:Bounds x="787" y="605" width="67" height="14" />
123158
</bpmndi:BPMNLabel>
124159
</bpmndi:BPMNShape>
125-
<bpmndi:BPMNShape id="Activity_0lxy7o7_di" bpmnElement="EVENT_SUB" isExpanded="true">
126-
<omgdc:Bounds x="940" y="90" width="350" height="200" />
127-
<bpmndi:BPMNLabel />
160+
<bpmndi:BPMNShape id="Activity_07u4w2m_di" bpmnElement="Activity_0v4hh2m" isExpanded="true">
161+
<omgdc:Bounds x="1090" y="480" width="350" height="200" />
128162
</bpmndi:BPMNShape>
129-
<bpmndi:BPMNShape id="Event_1mfo1h4_di" bpmnElement="LINK_CATCH">
130-
<omgdc:Bounds x="362" y="122" width="36" height="36" />
131-
<bpmndi:BPMNLabel>
132-
<omgdc:Bounds x="346" y="98" width="68" height="14" />
133-
</bpmndi:BPMNLabel>
163+
<bpmndi:BPMNShape id="Activity_1kqyx9a_di" bpmnElement="Task_AdHoc">
164+
<omgdc:Bounds x="1200" y="540" width="100" height="80" />
165+
<bpmndi:BPMNLabel />
134166
</bpmndi:BPMNShape>
135-
<bpmndi:BPMNEdge id="Association_1ixehz7_di" bpmnElement="Association_1ixehz7">
136-
<di:waypoint x="700" y="638" />
137-
<di:waypoint x="700" y="700" />
138-
<di:waypoint x="770" y="700" />
167+
<bpmndi:BPMNEdge id="Flow_169nah2_di" bpmnElement="Flow_169nah2">
168+
<di:waypoint x="1008" y="580" />
169+
<di:waypoint x="1090" y="580" />
170+
</bpmndi:BPMNEdge>
171+
<bpmndi:BPMNEdge id="Flow_1qprlnl_di" bpmnElement="Flow_1qprlnl">
172+
<di:waypoint x="1440" y="580" />
173+
<di:waypoint x="1522" y="580" />
139174
</bpmndi:BPMNEdge>
175+
<bpmndi:BPMNShape id="Group_14ev8gw_di" bpmnElement="Group_14ev8gw">
176+
<omgdc:Bounds x="560" y="190" width="300" height="300" />
177+
</bpmndi:BPMNShape>
140178
<bpmndi:BPMNShape id="Event_1gmxxzr_di" bpmnElement="COMPENSATION_ACTIVITY_EVENT">
141179
<omgdc:Bounds x="682" y="602" width="36" height="36" />
142180
<bpmndi:BPMNLabel>
143181
<omgdc:Bounds x="655" y="645" width="90" height="27" />
144182
</bpmndi:BPMNLabel>
145183
</bpmndi:BPMNShape>
146-
<bpmndi:BPMNEdge id="Flow_16zubsb_di" bpmnElement="Flow_16zubsb">
147-
<di:waypoint x="558" y="580" />
148-
<di:waypoint x="630" y="580" />
149-
</bpmndi:BPMNEdge>
150-
<bpmndi:BPMNEdge id="Flow_044vrdf_di" bpmnElement="Flow_044vrdf">
151-
<di:waypoint x="730" y="580" />
152-
<di:waypoint x="802" y="580" />
153-
</bpmndi:BPMNEdge>
154-
<bpmndi:BPMNShape id="Group_14ev8gw_di" bpmnElement="Group_14ev8gw">
155-
<omgdc:Bounds x="560" y="190" width="300" height="300" />
156-
</bpmndi:BPMNShape>
157184
<bpmndi:BPMNShape id="Event_0nahpgz_di" bpmnElement="BOUNDARY">
158185
<omgdc:Bounds x="302" y="322" width="36" height="36" />
159186
<bpmndi:BPMNLabel>
@@ -187,6 +214,19 @@
187214
<di:waypoint x="380" y="230" />
188215
<di:waypoint x="288" y="230" />
189216
</bpmndi:BPMNEdge>
217+
<bpmndi:BPMNEdge id="Flow_16zubsb_di" bpmnElement="Flow_16zubsb">
218+
<di:waypoint x="558" y="580" />
219+
<di:waypoint x="630" y="580" />
220+
</bpmndi:BPMNEdge>
221+
<bpmndi:BPMNEdge id="Flow_044vrdf_di" bpmnElement="Flow_044vrdf">
222+
<di:waypoint x="730" y="580" />
223+
<di:waypoint x="802" y="580" />
224+
</bpmndi:BPMNEdge>
225+
<bpmndi:BPMNEdge id="Association_1ixehz7_di" bpmnElement="Association_1ixehz7">
226+
<di:waypoint x="700" y="638" />
227+
<di:waypoint x="700" y="700" />
228+
<di:waypoint x="770" y="700" />
229+
</bpmndi:BPMNEdge>
190230
</bpmndi:BPMNPlane>
191231
</bpmndi:BPMNDiagram>
192232
</definitions>

test/rules/no-implicit-start/valid.bpmn

+49-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="Camunda Modeler" exporterVersion="5.21.0">
2+
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="Camunda Modeler" exporterVersion="5.34.0-dev">
33
<process id="PROCESS" isExecutable="false">
44
<endEvent id="END_EVENT" name="END_EVENT">
55
<incoming>Flow_1w3680k</incoming>
@@ -35,6 +35,19 @@
3535
<compensateEventDefinition id="CompensateEventDefinition_0b10fth" />
3636
</boundaryEvent>
3737
<task id="FOR_COMPENSATION" name="FOR_COMPENSATION" isForCompensation="true" />
38+
<adHocSubProcess id="Activity_15yansu">
39+
<incoming>Flow_093ukve</incoming>
40+
<outgoing>Flow_1wmltqf</outgoing>
41+
<task id="Activity_1snzwjt" />
42+
</adHocSubProcess>
43+
<startEvent id="StartEvent_AdHoc" name="START ADHOC">
44+
<outgoing>Flow_093ukve</outgoing>
45+
</startEvent>
46+
<sequenceFlow id="Flow_093ukve" sourceRef="StartEvent_AdHoc" targetRef="Activity_15yansu" />
47+
<endEvent id="EndEvent_Adhoc" name="END ADHOC">
48+
<incoming>Flow_1wmltqf</incoming>
49+
</endEvent>
50+
<sequenceFlow id="Flow_1wmltqf" sourceRef="Activity_15yansu" targetRef="EndEvent_Adhoc" />
3851
<group id="Group_14ev8gw" />
3952
<association id="Association_0flxzv9" associationDirection="One" sourceRef="Event_07bzf1s" targetRef="FOR_COMPENSATION" />
4053
</process>
@@ -74,9 +87,17 @@
7487
<bpmndi:BPMNShape id="DataStoreReference_0bpv41p_di" bpmnElement="DataStoreReference_0bpv41p">
7588
<omgdc:Bounds x="525" y="315" width="50" height="50" />
7689
</bpmndi:BPMNShape>
77-
<bpmndi:BPMNShape id="Activity_0bfzxxp_di" bpmnElement="FOR_COMPENSATION">
78-
<omgdc:Bounds x="160" y="300" width="100" height="80" />
79-
<bpmndi:BPMNLabel />
90+
<bpmndi:BPMNShape id="Event_0xy6ro7_di" bpmnElement="StartEvent_AdHoc">
91+
<omgdc:Bounds x="572" y="662" width="36" height="36" />
92+
<bpmndi:BPMNLabel>
93+
<omgdc:Bounds x="554" y="705" width="78" height="14" />
94+
</bpmndi:BPMNLabel>
95+
</bpmndi:BPMNShape>
96+
<bpmndi:BPMNShape id="Event_10dxc44_di" bpmnElement="EndEvent_Adhoc">
97+
<omgdc:Bounds x="1032" y="662" width="36" height="36" />
98+
<bpmndi:BPMNLabel>
99+
<omgdc:Bounds x="1018" y="705" width="66" height="14" />
100+
</bpmndi:BPMNLabel>
80101
</bpmndi:BPMNShape>
81102
<bpmndi:BPMNShape id="Activity_1jhbus4_di" bpmnElement="EVENT_SUB" isExpanded="true">
82103
<omgdc:Bounds x="1050" y="40" width="350" height="200" />
@@ -88,16 +109,30 @@
88109
<omgdc:Bounds x="584" y="115" width="73" height="14" />
89110
</bpmndi:BPMNLabel>
90111
</bpmndi:BPMNShape>
91-
<bpmndi:BPMNEdge id="Association_0flxzv9_di" bpmnElement="Association_0flxzv9">
92-
<di:waypoint x="312" y="340" />
93-
<di:waypoint x="260" y="340" />
94-
</bpmndi:BPMNEdge>
95-
<bpmndi:BPMNShape id="Event_1a3fgyg_di" bpmnElement="Event_07bzf1s">
96-
<omgdc:Bounds x="312" y="322" width="36" height="36" />
112+
<bpmndi:BPMNShape id="Activity_0bfzxxp_di" bpmnElement="FOR_COMPENSATION">
113+
<omgdc:Bounds x="160" y="300" width="100" height="80" />
114+
<bpmndi:BPMNLabel />
97115
</bpmndi:BPMNShape>
116+
<bpmndi:BPMNShape id="Activity_1drnytr_di" bpmnElement="Activity_15yansu" isExpanded="true">
117+
<omgdc:Bounds x="645" y="580" width="350" height="200" />
118+
</bpmndi:BPMNShape>
119+
<bpmndi:BPMNShape id="Activity_1snzwjt_di" bpmnElement="Activity_1snzwjt">
120+
<omgdc:Bounds x="770" y="630" width="100" height="80" />
121+
</bpmndi:BPMNShape>
122+
<bpmndi:BPMNEdge id="Flow_093ukve_di" bpmnElement="Flow_093ukve">
123+
<di:waypoint x="608" y="680" />
124+
<di:waypoint x="645" y="680" />
125+
</bpmndi:BPMNEdge>
126+
<bpmndi:BPMNEdge id="Flow_1wmltqf_di" bpmnElement="Flow_1wmltqf">
127+
<di:waypoint x="995" y="680" />
128+
<di:waypoint x="1032" y="680" />
129+
</bpmndi:BPMNEdge>
98130
<bpmndi:BPMNShape id="Group_14ev8gw_di" bpmnElement="Group_14ev8gw">
99131
<omgdc:Bounds x="670" y="190" width="300" height="300" />
100132
</bpmndi:BPMNShape>
133+
<bpmndi:BPMNShape id="Event_1a3fgyg_di" bpmnElement="Event_07bzf1s">
134+
<omgdc:Bounds x="312" y="322" width="36" height="36" />
135+
</bpmndi:BPMNShape>
101136
<bpmndi:BPMNShape id="Event_0wn1jq0_di" bpmnElement="BOUNDARY">
102137
<omgdc:Bounds x="412" y="322" width="36" height="36" />
103138
<bpmndi:BPMNLabel>
@@ -120,6 +155,10 @@
120155
<di:waypoint x="380" y="475" />
121156
<di:waypoint x="380" y="532" />
122157
</bpmndi:BPMNEdge>
158+
<bpmndi:BPMNEdge id="Association_0flxzv9_di" bpmnElement="Association_0flxzv9">
159+
<di:waypoint x="312" y="340" />
160+
<di:waypoint x="260" y="340" />
161+
</bpmndi:BPMNEdge>
123162
</bpmndi:BPMNPlane>
124163
</bpmndi:BPMNDiagram>
125164
</definitions>

0 commit comments

Comments
 (0)