GatewayGateways are used to control the flow of processes. 1. Exclusive GatewayAn exclusive gateway (also called an XOR gateway, or more professionally, an exclusive data-based gateway) is used to model decision making in a process. When execution reaches this gateway, all outgoing sequence flows are evaluated in the order in which they are defined. The first sequence flow whose condition evaluates to true (a sequence flow is considered true when no condition is set) is chosen to continue the process. Please note that the meaning of the exit sequence flow here is different from the general case in BPMN 2.0. In general, all sequence flows whose conditions evaluate to true are selected and executed in parallel. When using an exclusive gateway, only one sequence flow is selected. When the conditions of multiple sequence flows all evaluate to true, only the sequence flow defined first in the XML is selected to continue the process. If there are no available sequence flows, an exception is thrown. An exclusive gateway is represented by a standard gateway (diamond) with an 'X' icon inside it, which stands for exclusive OR. Please note that a gateway without an icon inside is an exclusive gateway by default. The BPMN 2.0 specification does not allow mixing diamonds with and without an X in the same process. Examples: /** If all conditions of the line out of the gateway are not met, a system exception will be thrown . But please note that the task has not been introduced, it is still the original task, and we can reset the process variables. @Test We can define conditions directly on the connection line before, so why do we need an exclusive gateway? In the case of direct connection, if none of the conditions are met, the process ends, and it ends abnormally! 2. Parallel GatewayThe parallel gateway allows the process to be divided into multiple branches, and multiple branches can also be brought together. The functionality of the parallel gateway is based on the incoming and outgoing sequence flows:
Note that if the same parallel gateway has multiple incoming and multiple outgoing sequence flows, it has both branching and converging functions. In this case, the gateway will first converge all incoming sequence flows and then split them into multiple parallel branches. The main difference from other gateways is that the parallel gateway does not resolve conditions. Even if conditions are defined in the sequence flow, they are ignored. Examples: After we execute the creation of the leave request and reach the parallel gateway, there are two records in the ACT_RU_TASK table. Then there are three records in ACT_RU_EXECUTION at the same time, and one task corresponds to two execution instances. 3. Included GatewayThe Inclusive Gateway can be seen as a combination of the Exclusive Gateway and the Parallel Gateway. Like the Exclusive Gateway, you can define conditions on the outgoing sequence flows and the Inclusive Gateway will resolve them. But the main difference is that the Inclusive Gateway can select more than one sequence flow, just like the Parallel Gateway. The functionality of the included gateway is based on incoming and outgoing sequence flows:
4. Event GatewayEvent gateways allow flow decisions based on events. Each outgoing sequence flow of the gateway is connected to an intermediate catching event. When the process reaches an event-based gateway, the gateway enters a waiting state: execution is suspended. At the same time, a corresponding event subscription is created for each outgoing sequence flow. The outgoing sequence flows of the event gateway are different from ordinary sequence flows. These sequence flows will not be actually "executed". Instead, they let the process engine decide which events the process executing to the event gateway needs to subscribe to. The following conditions should be considered: The event gateway must have two or more outgoing sequence flows; After the event gateway, only the intermediateCatchEvent type can be used (activiti does not support connecting ReceiveTask based on the event gateway); An intermediate capturing event connected to an event gateway must have only one entry sequence flow. |
<<: Ten times faster than 5G? What is the future of 10G network?
>>: 5G, you will be able to make phone calls
[Updated in August 2023] Please note that the off...
[[429302]] Japan has once again experienced a maj...
1. Industrial wireless network development and se...
Preface The previous article "Whether it is ...
HostYun launched this year's Double 11 promot...
In the era of popular Internet, many families hav...
In recent years, under the guidance of the "...
[[427625]] AI is expected to transform every indu...
Tencent Cloud's lightweight application serve...
Krypt has released the September discount informa...
Earlier this month, we shared a summary of RackNe...
In addition to the recharge gift event, RAKsmart ...
1. Introduction to OSPF OSPF (Open Shortest Path ...