In jd-easyflow,inclusive
Usually with the conditional branch in the process (conditions
) configuration related, used to control the execution logic of multiple conditional branches. whenconditionType
Set asinclusive
When indicating that all conditions in multiple condition branches are evaluated instead ofexclusive
That way, the evaluation will be terminated once a certain condition is met.
Here is how to define the use in jd-easyflow's JSON process fileinclusive
Example of event triggering mechanism:
1. Define the conditional branch:
existpost
In configuration, useconditions
Fields to define multiple conditional branches. Each conditional branch containswhen
(conditional expression) andto
(Node to jump to when the condition is met).
2. Settingsinclusive
model:
existconditions
In the field, you can set itconditionType
forinclusive
, so that all conditions will be evaluated.
3. Configure the default branch:
If no conditions are met, you can usedefaultTo
Field specifies the default branch.
The following is a specific JSON process file example showing how to use itinclusive
:
{ "id": "flow_with_inclusive", "name": "Flow with Inclusive Conditions", "nodes": [ { "id": "start_node", "name": "Start Node", "action": { "createExp": "new ()" }, "start": true, "post": { "to": "decision_node" } }, { "id": "decision_node", "name": "Decision Node", "post": { "conditions": [ { "when": "${condition1}", "to": "node1" }, { "when": "${condition2}", "to": "node2" } ], "conditionType": "inclusive", "defaultTo": "default_node" } }, { "id": "node1", "name": "Node 1", "action": { "createExp": "new .Node1Action()" }, "post": { "to": "end_node" } }, { "id": "node2", "name": "Node 2", "action": { "createExp": "new .Node2Action()" }, "post": { "to": "end_node" } }, { "id": "default_node", "name": "Default Node", "action": { "createExp": "new ()" }, "post": { "to": "end_node" } }, { "id": "end_node", "name": "End Node", "action": { "createExp": "new ()" } } ] }
In this example,decision_node
is a decision node, which has two conditional branches, both set toinclusive
model. This means the process engine evaluatescondition1
andcondition2
, if they all satisfy, the process can enter at the same timenode1
andnode2
. If no conditions are met, the process will enterdefault_node
. This configuration allows for more complex process control logic, allowing processes to dynamically branch to different nodes according to multiple conditions.
How to use it in jd-easyflowinclusive
Detailed description and examples of
This is the end of this article about the example usage of inclusive in jd-easyflow. For more related jd-easyflow inclusive content, please search for my previous articles or continue to browse the related articles below. I hope everyone will support me in the future!