Skip to content

Commit

Permalink
fix(no-loop): return no next elements if no call activity loop
Browse files Browse the repository at this point in the history
Closes #155
  • Loading branch information
philippfromme committed Feb 14, 2024
1 parent f27d3eb commit e16027f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 2 additions & 0 deletions rules/camunda-cloud/no-loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ function getNextFlowElements(flowElement) {
}
}
}

return [];
} else if (is(flowElement, 'bpmn:SubProcess')) {
return flowElement
.get('flowElements').filter(flowElement => is(flowElement, 'bpmn:StartEvent'));
Expand Down
29 changes: 16 additions & 13 deletions test/camunda-cloud/no-loop.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,28 @@ const valid = [
moddleElement: createModdle(createDefinitions(`
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1</bpmn:outgoing>
<bpmn:outgoing>SeqeuenceFlow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:manualTask id="ManualTask_1">
<bpmn:incoming>SequenceFlow_1</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_2</bpmn:outgoing>
</bpmn:manualTask>
<bpmn:sequenceFlow id="SequenceFlow_1" sourceRef="StartEvent_1" targetRef="ManualTask_1" />
<bpmn:sequenceFlow id="SequenceFlow_2" sourceRef="ManualTask_1" targetRef="CallActivity_1" />
<bpmn:endEvent id="EndEvent_1">
<bpmn:incoming>SequenceFlow_3</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_3" sourceRef="CallActivity_1" targetRef="EndEvent_1" />
<bpmn:callActivity id="CallActivity_1">
<bpmn:extensionElements>
<zeebe:calledElement processId="Process_2" propagateAllChildVariables="false" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_2</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_3</bpmn:outgoing>
<bpmn:incoming>SeqeuenceFlow_1</bpmn:incoming>
<bpmn:incoming>SeqeuenceFlow_4</bpmn:incoming>
<bpmn:outgoing>SeqeuenceFlow_2</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="SeqeuenceFlow_1" sourceRef="StartEvent_1" targetRef="CallActivity_1" />
<bpmn:exclusiveGateway id="ExclusiveGateway_1">
<bpmn:incoming>SeqeuenceFlow_2</bpmn:incoming>
<bpmn:outgoing>SeqeuenceFlow_3</bpmn:outgoing>
<bpmn:outgoing>SeqeuenceFlow_4</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SeqeuenceFlow_2" sourceRef="CallActivity_1" targetRef="ExclusiveGateway_1" />
<bpmn:endEvent id="EndEvent_1">
<bpmn:incoming>SeqeuenceFlow_3</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SeqeuenceFlow_3" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_1" />
<bpmn:sequenceFlow id="SeqeuenceFlow_4" sourceRef="ExclusiveGateway_1" targetRef="CallActivity_1" />
</bpmn:process>
`))
},
Expand Down

0 comments on commit e16027f

Please sign in to comment.