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:51] – [Edit diagram] 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 =====
 +
 +<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_1em6o86</outgoing>
 +    </task>
 +    <task id="Activity_0317o28" name="Do this">
 +      <incoming>Flow_04is4m4</incoming>
 +    </task>
 +    <sequenceFlow id="Flow_04is4m4" name="if this" sourceRef="Gateway_0gn9r9q" targetRef="Activity_0317o28" />
 +    <task id="Activity_0fkgdc1" name="Do that">
 +      <incoming>Flow_02u49rt</incoming>
 +    </task>
 +    <sequenceFlow id="Flow_02u49rt" name="if that" sourceRef="Gateway_0gn9r9q" targetRef="Activity_0fkgdc1" />
 +    <sequenceFlow id="Flow_1em6o86" sourceRef="Activity_0131ilb" targetRef="Gateway_0gn9r9q" />
 +    <inclusiveGateway id="Gateway_0gn9r9q">
 +      <incoming>Flow_1em6o86</incoming>
 +      <outgoing>Flow_02u49rt</outgoing>
 +      <outgoing>Flow_04is4m4</outgoing>
 +    </inclusiveGateway>
 +  </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="Gateway_0wcaf75_di" bpmnElement="Gateway_0gn9r9q">
 +        <omgdc:Bounds x="415" y="165" width="50" height="50" />
 +      </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:BPMNShape id="Activity_0317o28_di" bpmnElement="Activity_0317o28">
 +        <omgdc:Bounds x="390" y="40" width="100" height="80" />
 +        <bpmndi:BPMNLabel />
 +      </bpmndi:BPMNShape>
 +      <bpmndi:BPMNEdge id="Flow_04is4m4_di" bpmnElement="Flow_04is4m4">
 +        <omgdi:waypoint x="440" y="165" />
 +        <omgdi:waypoint x="440" y="120" />
 +        <bpmndi:BPMNLabel>
 +          <omgdc:Bounds x="446" y="142" width="27" height="14" />
 +        </bpmndi:BPMNLabel>
 +      </bpmndi:BPMNEdge>
 +      <bpmndi:BPMNEdge id="Flow_02u49rt_di" bpmnElement="Flow_02u49rt">
 +        <omgdi:waypoint x="440" y="215" />
 +        <omgdi:waypoint x="440" y="260" />
 +        <bpmndi:BPMNLabel>
 +          <omgdc:Bounds x="446" y="224" width="28" height="14" />
 +        </bpmndi:BPMNLabel>
 +      </bpmndi:BPMNEdge>
 +      <bpmndi:BPMNEdge id="Flow_1em6o86_di" bpmnElement="Flow_1em6o86">
 +        <omgdi:waypoint x="360" y="190" />
 +        <omgdi:waypoint x="415" y="190" />
 +      </bpmndi:BPMNEdge>
 +    </bpmndi:BPMNPlane>
 +  </bpmndi:BPMNDiagram>
 +</definitions>
 +</bpmnio>
 +===== ✘ How NOT to =====
  
 <bpmnio type="bpmn"> <bpmnio type="bpmn">
Line 21: Line 81:
     </task>     </task>
     <sequenceFlow id="Flow_04is4m4" name="if this" sourceRef="Activity_0131ilb" targetRef="Activity_0317o28">     <sequenceFlow id="Flow_04is4m4" name="if this" sourceRef="Activity_0131ilb" targetRef="Activity_0317o28">
-      <conditionExpression xsi:type="tFormalExpression"></conditionExpression>+      <conditionExpression xsi:type="tFormalExpression" />
     </sequenceFlow>     </sequenceFlow>
     <task id="Activity_0fkgdc1" name="Do that">     <task id="Activity_0fkgdc1" name="Do that">
Line 27: Line 87:
     </task>     </task>
     <sequenceFlow id="Flow_02u49rt" name="if that" sourceRef="Activity_0131ilb" targetRef="Activity_0fkgdc1">     <sequenceFlow id="Flow_02u49rt" name="if that" sourceRef="Activity_0131ilb" targetRef="Activity_0fkgdc1">
-      <conditionExpression xsi:type="tFormalExpression"></conditionExpression>+      <conditionExpression xsi:type="tFormalExpression" />
     </sequenceFlow>     </sequenceFlow>
   </process>   </process>
Line 36: Line 96:
       </bpmndi:BPMNShape>       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="Activity_0317o28_di" bpmnElement="Activity_0317o28">       <bpmndi:BPMNShape id="Activity_0317o28_di" bpmnElement="Activity_0317o28">
-        <omgdc:Bounds x="390" y="60" width="100" height="80" />+        <omgdc:Bounds x="390" y="40" width="100" height="80" />
         <bpmndi:BPMNLabel />         <bpmndi:BPMNLabel />
       </bpmndi:BPMNShape>       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="Activity_0fkgdc1_di" bpmnElement="Activity_0fkgdc1">       <bpmndi:BPMNShape id="Activity_0fkgdc1_di" bpmnElement="Activity_0fkgdc1">
-        <omgdc:Bounds x="390" y="240" width="100" height="80" />+        <omgdc:Bounds x="390" y="260" width="100" height="80" />
         <bpmndi:BPMNLabel />         <bpmndi:BPMNLabel />
       </bpmndi:BPMNShape>       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="Flow_04is4m4_di" bpmnElement="Flow_04is4m4">       <bpmndi:BPMNEdge id="Flow_04is4m4_di" bpmnElement="Flow_04is4m4">
         <omgdi:waypoint x="310" y="150" />         <omgdi:waypoint x="310" y="150" />
-        <omgdi:waypoint x="310" y="100" /> +        <omgdi:waypoint x="310" y="80" /> 
-        <omgdi:waypoint x="390" y="100" />+        <omgdi:waypoint x="390" y="80" />
         <bpmndi:BPMNLabel>         <bpmndi:BPMNLabel>
-          <omgdc:Bounds x="326" y="103" width="27" height="14" />+          <omgdc:Bounds x="326" y="83" width="27" height="14" />
         </bpmndi:BPMNLabel>         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="Flow_02u49rt_di" bpmnElement="Flow_02u49rt">       <bpmndi:BPMNEdge id="Flow_02u49rt_di" bpmnElement="Flow_02u49rt">
         <omgdi:waypoint x="310" y="230" />         <omgdi:waypoint x="310" y="230" />
-        <omgdi:waypoint x="310" y="280" /> +        <omgdi:waypoint x="310" y="300" /> 
-        <omgdi:waypoint x="390" y="280" />+        <omgdi:waypoint x="390" y="300" />
         <bpmndi:BPMNLabel>         <bpmndi:BPMNLabel>
-          <omgdc:Bounds x="326" y="263" width="28" height="14" />+          <omgdc:Bounds x="326" y="283" width="28" height="14" />
         </bpmndi:BPMNLabel>         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>       </bpmndi:BPMNEdge>
Line 63: Line 123:
 </definitions> </definitions>
 </bpmnio> </bpmnio>
-===== ✘ How NOT to ===== 
- 
-Put antipattern (BPMN diagrams) here 
- 
 ===== 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//