Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fake-join and no-implicit-split rules now analyze all activities not only tasks (fixes #125) #126

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rules/fake-join.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function() {
function check(node, reporter) {

if (!isAny(node, [
'bpmn:Task',
'bpmn:Activity',
'bpmn:Event'
])) {
return;
Expand Down
2 changes: 1 addition & 1 deletion rules/no-implicit-split.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function() {
function check(node, reporter) {

if (!isAny(node, [
'bpmn:Task',
'bpmn:Activity',
'bpmn:Event'
])) {
return;
Expand Down
9 changes: 8 additions & 1 deletion test/rules/fake-join.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ RuleTester.verify('fake-join', rule, {
],
invalid: [
{
moddleElement: readModdle(__dirname + '/fake-join/invalid.bpmn'),
moddleElement: readModdle(__dirname + '/fake-join/invalid-task.bpmn'),
report: {
id: 'Element',
message: 'Incoming flows do not join'
}
},
{
moddleElement: readModdle(__dirname + '/fake-join/invalid-callActivity.bpmn'),
report: {
id: 'Element',
message: 'Incoming flows do not join'
Expand Down
42 changes: 42 additions & 0 deletions test/rules/fake-join/invalid-callActivity.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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" id="Definitions_06dilz7" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.16.0">
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1lepxc8">
<bpmn:outgoing>SequenceFlow_1uh5qzh</bpmn:outgoing>
</bpmn:intermediateThrowEvent>
<bpmn:sequenceFlow id="SequenceFlow_1uh5qzh" sourceRef="IntermediateThrowEvent_1lepxc8" targetRef="Element" />
<bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1uolq2e">
<bpmn:outgoing>SequenceFlow_1mrgwdi</bpmn:outgoing>
</bpmn:intermediateThrowEvent>
<bpmn:sequenceFlow id="SequenceFlow_1mrgwdi" sourceRef="IntermediateThrowEvent_1uolq2e" targetRef="Element" />
<bpmn:callActivity id="Element">
<bpmn:incoming>SequenceFlow_1uh5qzh</bpmn:incoming>
<bpmn:incoming>SequenceFlow_1mrgwdi</bpmn:incoming>
</bpmn:callActivity>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="IntermediateThrowEvent_1lepxc8_di" bpmnElement="IntermediateThrowEvent_1lepxc8">
<dc:Bounds x="152" y="43" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateThrowEvent_1uolq2e_di" bpmnElement="IntermediateThrowEvent_1uolq2e">
<dc:Bounds x="152" y="129" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0pcc5jm_di" bpmnElement="Element">
<dc:Bounds x="285" y="66" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1uh5qzh_di" bpmnElement="SequenceFlow_1uh5qzh">
<di:waypoint x="188" y="61" />
<di:waypoint x="237" y="61" />
<di:waypoint x="237" y="106" />
<di:waypoint x="285" y="106" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1mrgwdi_di" bpmnElement="SequenceFlow_1mrgwdi">
<di:waypoint x="188" y="147" />
<di:waypoint x="237" y="147" />
<di:waypoint x="237" y="106" />
<di:waypoint x="285" y="106" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
7 changes: 7 additions & 0 deletions test/rules/no-implicit-split.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ RuleTester.verify('no-implicit-split', rule, {
id: 'Element',
message: 'Flow splits implicitly'
}
},
{
moddleElement: readModdle(__dirname + '/no-implicit-split/invalid-callActivity.bpmn'),
report: {
id: 'Element',
message: 'Flow splits implicitly'
}
}
]
});
42 changes: 42 additions & 0 deletions test/rules/no-implicit-split/invalid-callActivity.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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" id="Definitions_0hq3mmd" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.16.0">
<bpmn:process id="Process" isExecutable="true">
<bpmn:task id="Target_1">
<bpmn:incoming>Flow_2</bpmn:incoming>
</bpmn:task>
<bpmn:task id="Target_2">
<bpmn:incoming>Flow_1</bpmn:incoming>
</bpmn:task>
<bpmn:sequenceFlow id="Flow_1" sourceRef="Element" targetRef="Target_2" />
<bpmn:sequenceFlow id="Flow_2" sourceRef="Element" targetRef="Target_1" />
<bpmn:callActivity id="Element">
<bpmn:outgoing>Flow_1</bpmn:outgoing>
<bpmn:outgoing>Flow_2</bpmn:outgoing>
</bpmn:callActivity>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process">
<bpmndi:BPMNShape id="Target_1_di" bpmnElement="Target_1">
<dc:Bounds x="304" y="190" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Target_2_di" bpmnElement="Target_2">
<dc:Bounds x="304" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1q344j0_di" bpmnElement="Element">
<dc:Bounds x="121" y="131" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1_di" bpmnElement="Flow_1">
<di:waypoint x="221" y="171" />
<di:waypoint x="263" y="171" />
<di:waypoint x="263" y="120" />
<di:waypoint x="304" y="120" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_2_di" bpmnElement="Flow_2">
<di:waypoint x="221" y="171" />
<di:waypoint x="263" y="171" />
<di:waypoint x="263" y="230" />
<di:waypoint x="304" y="230" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>