Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:rule:do_not_use_conditional_flows [2024-01-08 16:47] – [✔ How to] Anatoly Belaychuken:rule:do_not_use_conditional_flows [2024-02-07 11:45] (current) – [Notes] Anatoly Belaychuk
Line 1: Line 1:
-====== 0DRAFT Don't use conditional flows ======+====== Don't use "flows with diamonds" ======
  
-{{tag>gateway}}+{{tag>gateway flow conditional_flow}}
  
-{{en:underconstruction.png?nolink&200|}} +Avoid conditional flows outgoing from activities, use gateways instead.
- +
-Avoid conditional flows, use gateways instead.+
  
 ===== ✔ How to ===== ===== ✔ How to =====
Line 11: Line 9:
 <bpmnio type="bpmn"> <bpmnio type="bpmn">
 <?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
-<definitions +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="http://bpmn.io" exporterVersion="0.10.1"> 
-    xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" +  <process id="Process_1vz64lo"> 
-    xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" +    <task id="Activity_0131ilb"> 
-    xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" +      <outgoing>Flow_1em6o86</outgoing> 
-    xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" +    </task
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +    <task id="Activity_0317o28" name="Do this"> 
-    id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" +      <incoming>Flow_04is4m4</incoming> 
-    targetNamespace="http://bpmn.io/bpmn" exporter="http://bpmn.io" exporterVersion="0.10.1"> +    </task> 
-    <collaboration id="Collaboration_1oh70al"+    <sequenceFlow id="Flow_04is4m4" name="if thissourceRef="Gateway_0gn9r9qtargetRef="Activity_0317o28" /> 
-        <participant id="Participant_1r8g02m" name="Add a BPMN diagram" processRef="Process_1" /+    <task id="Activity_0fkgdc1" name="Do that"> 
-    </collaboration> +      <incoming>Flow_02u49rt</incoming> 
-    <process id="Process_1" isExecutable="false"> +    </task
-        <startEvent id="StartEvent_1" name="Start"> +    <sequenceFlow id="Flow_02u49rt" name="if that" sourceRef="Gateway_0gn9r9q" targetRef="Activity_0fkgdc1" /> 
-        <outgoing>SequenceFlow_1</outgoing> +    <sequenceFlow id="Flow_1em6o86" sourceRef="Activity_0131ilb" targetRef="Gateway_0gn9r9q" /> 
-        </startEvent+    <inclusiveGateway id="Gateway_0gn9r9q"
-        <task id="Task_1" name="Do Something"> +      <incoming>Flow_1em6o86</incoming
-        <incoming>SequenceFlow_1</incoming> +      <outgoing>Flow_02u49rt</outgoing
-        <incoming>SequenceFlow_121ul2c</incoming> +      <outgoing>Flow_04is4m4</outgoing
-        <incoming>SequenceFlow_0nuwads</incoming> +    </inclusiveGateway> 
-        <outgoing>SequenceFlow_2</outgoing> +  </process> 
-        </task> +  <bpmndi:BPMNDiagram id="BpmnDiagram_1"> 
-        <exclusiveGateway id="ExclusiveGateway_1" name="Result OKgatewayDirection="Diverging"+    <bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1vz64lo"> 
-        <incoming>SequenceFlow_2</incoming> +      <bpmndi:BPMNShape id="Activity_0131ilb_di" bpmnElement="Activity_0131ilb"> 
-        <outgoing>SequenceFlow_0snv4kp</outgoing> +        <omgdc:Bounds x="260" y="150" width="100" height="80" /> 
-        <outgoing>SequenceFlow_0nuwads</outgoing> +      </bpmndi:BPMNShape> 
-        </exclusiveGateway> +      <bpmndi:BPMNShape id="Gateway_0wcaf75_di" bpmnElement="Gateway_0gn9r9q"> 
-        <task id="Task_17knw8lname="Monitor"> +        <omgdc:Bounds x="415" y="165" width="50" height="50" /> 
-        <outgoing>SequenceFlow_121ul2c</outgoing+      </bpmndi:BPMNShape> 
-        </task+      <bpmndi:BPMNShape id="Activity_0fkgdc1_di" bpmnElement="Activity_0fkgdc1"> 
-        <endEvent id="EndEvent_0oj7l6x" name="End"> +        <omgdc:Bounds x="390" y="260" width="100" height="80" /> 
-        <incoming>SequenceFlow_0snv4kp</incoming> +        <bpmndi:BPMNLabel /> 
-        </endEvent+      </bpmndi:BPMNShape> 
-        <sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="Task_1" /> +      <bpmndi:BPMNShape id="Activity_0317o28_di" bpmnElement="Activity_0317o28"> 
-        <sequenceFlow id="SequenceFlow_121ul2c" sourceRef="Task_17knw8l" targetRef="Task_1" /> +        <omgdc:Bounds x="390" y="40" width="100" height="80" /> 
-        <sequenceFlow id="SequenceFlow_0nuwads" name="No" sourceRef="ExclusiveGateway_1" targetRef="Task_1" /> +        <bpmndi:BPMNLabel /> 
-        <sequenceFlow id="SequenceFlow_2" sourceRef="Task_1" targetRef="ExclusiveGateway_1" /> +      </bpmndi:BPMNShape> 
-        <sequenceFlow id="SequenceFlow_0snv4kp" name="Yes" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_0oj7l6x" /> +      <bpmndi:BPMNEdge id="Flow_04is4m4_di" bpmnElement="Flow_04is4m4"> 
-    </process> +        <omgdi:waypoint x="440" y="165" /> 
-        <bpmndi:BPMNDiagram id="BpmnDiagram_1"> +        <omgdi:waypoint x="440" y="120" /> 
-        <bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Collaboration_1oh70al"> +        <bpmndi:BPMNLabel> 
-        <bpmndi:BPMNShape id="Participant_1r8g02m_di" bpmnElement="Participant_1r8g02m"> +          <omgdc:Bounds x="446" y="142" width="27" height="14" /> 
-            <omgdc:Bounds x="104" y="78" width="668" height="297" /> +        </bpmndi:BPMNLabel> 
-        </bpmndi:BPMNShape> +      </bpmndi:BPMNEdge> 
-        <bpmndi:BPMNShape id="StartEvent_1_gui" bpmnElement="StartEvent_1"> +      <bpmndi:BPMNEdge id="Flow_02u49rt_di" bpmnElement="Flow_02u49rt"> 
-            <omgdc:Bounds x="242" y="187" width="30" height="30" /> +        <omgdi:waypoint x="440" y="215" /> 
-            <bpmndi:BPMNLabel> +        <omgdi:waypoint x="440" y="260" /> 
-            <omgdc:Bounds x="212" y="219" width="90" height="22" /> +        <bpmndi:BPMNLabel> 
-            </bpmndi:BPMNLabel> +          <omgdc:Bounds x="446" y="224" width="28" height="14" /> 
-        </bpmndi:BPMNShape> +        </bpmndi:BPMNLabel> 
-        <bpmndi:BPMNShape id="Task_1_gui" bpmnElement="Task_1"> +      </bpmndi:BPMNEdge> 
-            <omgdc:Bounds x="340" y="162" width="100" height="80" /> +      <bpmndi:BPMNEdge id="Flow_1em6o86_di" bpmnElement="Flow_1em6o86"> 
-            <bpmndi:BPMNLabel+        <omgdi:waypoint x="360" y="190" /> 
-            <omgdc:Bounds x="118.85714721679688" y="47" width="82.28570556640625" height="12" /> +        <omgdi:waypoint x="415" y="190" /> 
-            </bpmndi:BPMNLabel> +      </bpmndi:BPMNEdge> 
-        </bpmndi:BPMNShape> +    </bpmndi:BPMNPlane> 
-        <bpmndi:BPMNShape id="ExclusiveGateway_1_gui" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true"> +  </bpmndi:BPMNDiagram>
-            <omgdc:Bounds x="508" y="182" width="40" height="40" /> +
-            <bpmndi:BPMNLabel> +
-            <omgdc:Bounds x="483" y="234" width="90" height="24" /> +
-            </bpmndi:BPMNLabel> +
-        </bpmndi:BPMNShape> +
-        <bpmndi:BPMNShape id="Task_17knw8l_di" bpmnElement="Task_17knw8l"> +
-            <omgdc:Bounds x="340" y="275" width="100" height="80" /> +
-        </bpmndi:BPMNShape> +
-        <bpmndi:BPMNShape id="EndEvent_0oj7l6x_di" bpmnElement="EndEvent_0oj7l6x"> +
-            <omgdc:Bounds x="648" y="184" width="36" height="36" /> +
-            <bpmndi:BPMNLabel+
-            <omgdc:Bounds x="621" y="220" width="90" height="20" /> +
-            </bpmndi:BPMNLabel> +
-        </bpmndi:BPMNShape> +
-        <bpmndi:BPMNEdge id="SequenceFlow_1_gui" bpmnElement="SequenceFlow_1"> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="272" y="202" /> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="340" y="202" /> +
-            <bpmndi:BPMNLabel> +
-            <omgdc:Bounds x="225" y="140" width="90" height="20" /> +
-            </bpmndi:BPMNLabel> +
-        </bpmndi:BPMNEdge> +
-        <bpmndi:BPMNEdge id="SequenceFlow_121ul2c_di" bpmnElement="SequenceFlow_121ul2c"+
-            <omgdi:waypoint xsi:type="omgdc:Point" x="390" y="275" /> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="390" y="242" /> +
-            <bpmndi:BPMNLabel> +
-            <omgdc:Bounds x="358" y="273" width="90" height="20" /> +
-            </bpmndi:BPMNLabel+
-        </bpmndi:BPMNEdge> +
-        <bpmndi:BPMNEdge id="SequenceFlow_0nuwads_di" bpmnElement="SequenceFlow_0nuwads"> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="528" y="182" /+
-            <omgdi:waypoint xsi:type="omgdc:Point" x="528" y="110" /> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="390" y="110" /> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="390" y="162" /> +
-            <bpmndi:BPMNLabel> +
-            <omgdc:Bounds x="495" y="140" width="90" height="20" /> +
-            </bpmndi:BPMNLabel+
-        </bpmndi:BPMNEdge> +
-        <bpmndi:BPMNEdge id="SequenceFlow_2_di" bpmnElement="SequenceFlow_2"> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="440" y="202" /> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="508" y="202" /> +
-            <bpmndi:BPMNLabel> +
-            <omgdc:Bounds x="433" y="192" width="90" height="20" /> +
-            </bpmndi:BPMNLabel> +
-        </bpmndi:BPMNEdge> +
-        <bpmndi:BPMNEdge id="SequenceFlow_0snv4kp_di" bpmnElement="SequenceFlow_0snv4kp"> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="548" y="202" /> +
-            <omgdi:waypoint xsi:type="omgdc:Point" x="648" y="202" /> +
-            <bpmndi:BPMNLabel> +
-            <omgdc:Bounds x="550" y="183" width="90" height="20" /> +
-            </bpmndi:BPMNLabel> +
-        </bpmndi:BPMNEdge> +
-        </bpmndi:BPMNPlane> +
-    </bpmndi:BPMNDiagram>+
 </definitions> </definitions>
 </bpmnio> </bpmnio>
 ===== ✘ How NOT to ===== ===== ✘ How NOT to =====
  
-Put antipattern (BPMN diagrams) here +<bpmnio type="bpmn"> 
 +<?xml version="1.0" encoding="UTF-8"?> 
 +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="http://bpmn.io" exporterVersion="0.10.1"> 
 +  <process id="Process_1vz64lo"> 
 +    <task id="Activity_0131ilb"> 
 +      <outgoing>Flow_04is4m4</outgoing> 
 +      <outgoing>Flow_02u49rt</outgoing> 
 +    </task> 
 +    <task id="Activity_0317o28" name="Do this"> 
 +      <incoming>Flow_04is4m4</incoming> 
 +    </task> 
 +    <sequenceFlow id="Flow_04is4m4" name="if this" sourceRef="Activity_0131ilb" targetRef="Activity_0317o28"> 
 +      <conditionExpression xsi:type="tFormalExpression" /> 
 +    </sequenceFlow> 
 +    <task id="Activity_0fkgdc1" name="Do that"> 
 +      <incoming>Flow_02u49rt</incoming> 
 +    </task> 
 +    <sequenceFlow id="Flow_02u49rt" name="if that" sourceRef="Activity_0131ilb" targetRef="Activity_0fkgdc1"> 
 +      <conditionExpression xsi:type="tFormalExpression" /> 
 +    </sequenceFlow> 
 +  </process> 
 +  <bpmndi:BPMNDiagram id="BpmnDiagram_1"> 
 +    <bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1vz64lo"> 
 +      <bpmndi:BPMNShape id="Activity_0131ilb_di" bpmnElement="Activity_0131ilb"> 
 +        <omgdc:Bounds x="260" y="150" width="100" height="80" /> 
 +      </bpmndi:BPMNShape> 
 +      <bpmndi:BPMNShape id="Activity_0317o28_di" bpmnElement="Activity_0317o28"> 
 +        <omgdc:Bounds x="390" y="40" width="100" height="80" /> 
 +        <bpmndi:BPMNLabel /> 
 +      </bpmndi:BPMNShape> 
 +      <bpmndi:BPMNShape id="Activity_0fkgdc1_di" bpmnElement="Activity_0fkgdc1"> 
 +        <omgdc:Bounds x="390" y="260" width="100" height="80" /> 
 +        <bpmndi:BPMNLabel /> 
 +      </bpmndi:BPMNShape> 
 +      <bpmndi:BPMNEdge id="Flow_04is4m4_di" bpmnElement="Flow_04is4m4"> 
 +        <omgdi:waypoint x="310" y="150" /> 
 +        <omgdi:waypoint x="310" y="80" /> 
 +        <omgdi:waypoint x="390" y="80" /> 
 +        <bpmndi:BPMNLabel> 
 +          <omgdc:Bounds x="326" y="83" width="27" height="14" /> 
 +        </bpmndi:BPMNLabel> 
 +      </bpmndi:BPMNEdge> 
 +      <bpmndi:BPMNEdge id="Flow_02u49rt_di" bpmnElement="Flow_02u49rt"> 
 +        <omgdi:waypoint x="310" y="230" /> 
 +        <omgdi:waypoint x="310" y="300" /> 
 +        <omgdi:waypoint x="390" y="300" /> 
 +        <bpmndi:BPMNLabel> 
 +          <omgdc:Bounds x="326" y="283" width="28" height="14" /> 
 +        </bpmndi:BPMNLabel> 
 +      </bpmndi:BPMNEdge> 
 +    </bpmndi:BPMNPlane> 
 +  </bpmndi:BPMNDiagram> 
 +</definitions> 
 +</bpmnio>
 ===== Notes ===== ===== Notes =====
  
-Put extra comments here (this section is optional) +  * It's sometimes argued that conditional flows saves one element (the gatewayand hence makes the diagram simpler. This argument is hardly acceptable because the gateway adds value to the diagram by making process execution logic clear. 
- +  * Conditional flows outgoing from an activity are idependent, hence the inclusive gateway in the "How to" diagram above.
-===== Exceptions ===== +
- +
-Specify exceptions to the rule above, if any +
 ===== See also ===== ===== See also =====
  
-  * [[one_outgoing_control_flow]]+  * [[en:rule:explicit_parallel_split]]
  
 ===== Автор(ы) ===== ===== Автор(ы) =====
  
- --- //[[user:bell|Anatoly Belaychuk]] 2023-09-10 13:40//+ ---  //[[user:bell|Anatoly Belaychuk]] 2024-01-08 17:01//