Both sides previous revision Previous revision Next revision | Previous revision |
en:rule:use-default-flow-only-in-executable-models [2024-08-22 20:09] – [✔ How to] Anatoly Belaychuk | en:rule:use-default-flow-only-in-executable-models [2025-04-01 11:25] (current) – [Exceptions] Anatoly Belaychuk |
---|
{{tag>default_flow}} | {{tag>default_flow}} |
| |
Use default flow only if the model to be executed by a process engine. | Use default flow outgoing from the exclusive gateway only if the model to be executed by a process engine. |
| |
===== ✔ How to ===== | ===== ✔ How to ===== |
* When used in the executable model, the default flow guarantees that the process will continue even if there is a mistake in the flow conditions. E.g. there may be a gateway controlled by a boolean attribute stored in a database. Process designer may define flow conditions as "if value is TRUE" and "if value is FALSE". It'd be a mistake because the attribute value may be also NULL. Therefore it's more robust to define explicit condition for one flow and mark the other as default flow. | * When used in the executable model, the default flow guarantees that the process will continue even if there is a mistake in the flow conditions. E.g. there may be a gateway controlled by a boolean attribute stored in a database. Process designer may define flow conditions as "if value is TRUE" and "if value is FALSE". It'd be a mistake because the attribute value may be also NULL. Therefore it's more robust to define explicit condition for one flow and mark the other as default flow. |
* In case of analytical model default flow doesn't add value but may confuse reader. | * In case of analytical model default flow doesn't add value but may confuse reader. |
| |
| ===== Exceptions ===== |
| |
| The above applies to exclusive gateways only. As for exclusive gateways, the default flow is useful both in executable and non-executable models: |
| |
| <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_1vphr67"> |
| <inclusiveGateway id="Gateway_0h14sq9" default="Flow_1fiufcu"> |
| <outgoing>Flow_0v7gy70</outgoing> |
| <outgoing>Flow_1q65gr0</outgoing> |
| <outgoing>Flow_1fiufcu</outgoing> |
| </inclusiveGateway> |
| <task id="Activity_0s9ye6s" name="Fix syntax errors"> |
| <incoming>Flow_0v7gy70</incoming> |
| <outgoing>Flow_1yo36j4</outgoing> |
| </task> |
| <sequenceFlow id="Flow_0v7gy70" name="syntax errors detected" sourceRef="Gateway_0h14sq9" targetRef="Activity_0s9ye6s" /> |
| <task id="Activity_0utrx8b" name="Fix substantial errors"> |
| <incoming>Flow_1q65gr0</incoming> |
| <outgoing>Flow_0lb8qxs</outgoing> |
| </task> |
| <sequenceFlow id="Flow_1q65gr0" name="substantial errors detected" sourceRef="Gateway_0h14sq9" targetRef="Activity_0utrx8b" /> |
| <sequenceFlow id="Flow_0lb8qxs" sourceRef="Activity_0utrx8b" targetRef="Gateway_0ncb01t" /> |
| <inclusiveGateway id="Gateway_0ncb01t"> |
| <incoming>Flow_0lb8qxs</incoming> |
| <incoming>Flow_1yo36j4</incoming> |
| <incoming>Flow_1fiufcu</incoming> |
| </inclusiveGateway> |
| <sequenceFlow id="Flow_1yo36j4" sourceRef="Activity_0s9ye6s" targetRef="Gateway_0ncb01t" /> |
| <sequenceFlow id="Flow_1fiufcu" sourceRef="Gateway_0h14sq9" targetRef="Gateway_0ncb01t" /> |
| </process> |
| <bpmndi:BPMNDiagram id="BpmnDiagram_1"> |
| <bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1vphr67"> |
| <bpmndi:BPMNShape id="Gateway_12uxsxa_di" bpmnElement="Gateway_0h14sq9"> |
| <omgdc:Bounds x="285" y="265" width="50" height="50" /> |
| </bpmndi:BPMNShape> |
| <bpmndi:BPMNShape id="Activity_0s9ye6s_di" bpmnElement="Activity_0s9ye6s"> |
| <omgdc:Bounds x="400" y="140" width="100" height="80" /> |
| <bpmndi:BPMNLabel /> |
| </bpmndi:BPMNShape> |
| <bpmndi:BPMNShape id="Activity_0utrx8b_di" bpmnElement="Activity_0utrx8b"> |
| <omgdc:Bounds x="390" y="370" width="100" height="80" /> |
| <bpmndi:BPMNLabel /> |
| </bpmndi:BPMNShape> |
| <bpmndi:BPMNShape id="Gateway_1rj8ws5_di" bpmnElement="Gateway_0ncb01t"> |
| <omgdc:Bounds x="545" y="265" width="50" height="50" /> |
| </bpmndi:BPMNShape> |
| <bpmndi:BPMNEdge id="Flow_0v7gy70_di" bpmnElement="Flow_0v7gy70"> |
| <omgdi:waypoint x="310" y="265" /> |
| <omgdi:waypoint x="310" y="180" /> |
| <omgdi:waypoint x="400" y="180" /> |
| <bpmndi:BPMNLabel> |
| <omgdc:Bounds x="293" y="220" width="64" height="27" /> |
| </bpmndi:BPMNLabel> |
| </bpmndi:BPMNEdge> |
| <bpmndi:BPMNEdge id="Flow_1q65gr0_di" bpmnElement="Flow_1q65gr0"> |
| <omgdi:waypoint x="310" y="315" /> |
| <omgdi:waypoint x="310" y="410" /> |
| <omgdi:waypoint x="390" y="410" /> |
| <bpmndi:BPMNLabel> |
| <omgdc:Bounds x="283" y="360" width="85" height="27" /> |
| </bpmndi:BPMNLabel> |
| </bpmndi:BPMNEdge> |
| <bpmndi:BPMNEdge id="Flow_0lb8qxs_di" bpmnElement="Flow_0lb8qxs"> |
| <omgdi:waypoint x="490" y="410" /> |
| <omgdi:waypoint x="570" y="410" /> |
| <omgdi:waypoint x="570" y="315" /> |
| </bpmndi:BPMNEdge> |
| <bpmndi:BPMNEdge id="Flow_1yo36j4_di" bpmnElement="Flow_1yo36j4"> |
| <omgdi:waypoint x="500" y="180" /> |
| <omgdi:waypoint x="570" y="180" /> |
| <omgdi:waypoint x="570" y="265" /> |
| </bpmndi:BPMNEdge> |
| <bpmndi:BPMNEdge id="Flow_1fiufcu_di" bpmnElement="Flow_1fiufcu"> |
| <omgdi:waypoint x="335" y="290" /> |
| <omgdi:waypoint x="545" y="290" /> |
| </bpmndi:BPMNEdge> |
| </bpmndi:BPMNPlane> |
| </bpmndi:BPMNDiagram> |
| </definitions> |
| </bpmnio> |
| |
===== See also ===== | ===== See also ===== |