In the K2 process system, any execution node in the process (one node can contain multiple events) may contain client events, server events, and sub-processes (IPC, inter Process Communication) events, or other events. Generally, we need to include a large number of business logic in the process node. For example, who is the executor of the process node? Which of the following prerequisites must be met before the executor starts a process node task. A process node is a key element in a process. The task executor approves, inputs, or extracts data from the process node.
To implement various complex business logic, K2 provides the following business rules:
1. Preceding Rule (pre-Rule)
Preceding Rule is a logical expression. When the expression is true, a process node can start execution. In other words, a process task can be generated only when the conditions are true. K2 provides three types of logical operators, including And, Or, And Xor, to implement logical combinations.
2. Start Rule (Start Rule)
Start Rule is a time Rule that indicates when a process task starts. For example, you can start the process task two hours after the process is initiated, or wait two hours to start the process task when the process variable is true.
3. Destination Rule (Executor Rules)
Used to specify who will execute the task. By default, K2's user information comes from Active Directory, so it can easily submit tasks to the user's Manager. If there are multiple possible task executors, We can first add all possible executors to the Destination Rule, and then set the conditions for each Rule, for example, when A is true, the Manager sent to Originator. When B is true, it is sent to GeneralManager. Alternatively, you can pre-define a Destination Queue and specify the Destination Queue directly.
4. Escalation Rule (expiration Rule)
If you want to complete some tasks within a certain period of time, for example, 8 hours, if the task is still not executed after 8 hours, we must perform some operations (for example, force the task to expire, or force the task to expire and flow the process to a process node.) in this case, we can define the task expiration rules. Expiration rules are used to specify when and how to perform such operations.
5. Succeeding Rule (post Rule)
Succeeding Rule is a logical expression. When it is true, a process node can complete the process. In other words, the process node can end under what circumstances. For example, if an approval task needs to be sent to five department managers for approval at the same time, we hope that the process will perform the next operation (the operation after rejection) as long as one of them does not agree ); with the consent of at least three department managers, the process will be transferred to the next operation (after the consent ). This is a good rule for K2, because the approval comments of each department manager are stored in their respective slots, and the variable values in the process are not overwritten, in this way, you can easily query the approval comments of each manager without defining variables for each manager. K2 provides three types of logical operators, including And, Or, And Xor, to implement logical combinations.