Decision
Introduction
A decision is an element that makes a choice based on a condition and follows one and only one of the outgoing sequence flows. For example, you can use a decision to decide whether a customer gets a discount or not. You can also use a decision to assign a different online meeting URL to an employee based on which time zone they work in.
Properties
An example of decision properties is represented in the image below:
The decision properties pane consists of the following sections:
Common Section
Caption
For more information, see the Caption section in Common Properties.
Decision Type
Decision type defines whether an expression or a rule is used to define conditions of the decision. Possible decision types are described in the table below:
Option | Description |
---|---|
Expression | Expressions can be used to create or change an object or a variable based on logic. |
Rule | A rule is a special kind of microflow, the outcomes of which can be used in a decision instead of calling a sub-microflow and using the return variable of that sub-microflow. The idea is that complicated decisions can be consolidated in rules and reused in various places. |
Error Handling Type
For more information, see the Error Handling Type section in Common Properties.
Expression Section
The Expression section is shown in the decision properties pane if the Decision Type property is set to Expression. The expression entered here is used to define the condition of the decision. For more information on expressions, see Microflow Expressions.
The expression should result in a Boolean or an enumeration.
Boolean Result
For an expression resulting in a Boolean, two flows are possible: true and false. For example, you can use an expression resulting in a Boolean to decide if a customer can get a discount by checking their membership status. The expression in this example is $Customer/Membership
.
Enumeration Result
The number of conditions available for the enumeration type depends on the corresponding enumeration values. There is also the empty condition available for enumeration: if the enumeration parameter or an attribute of an object is unassigned, a sequence flow with the caption (empty) is followed.
For example, if you want to assign a different meeting URL based on the working location of an employee, you can use an expression resulting in an enumeration.
In the example below, the microflow parameter is MeetingRegistration. Depending on where the employee works, a different meeting URL is assigned. If an employee did not select a working location when registering for the meeting, the flow labelled (empty) is followed and an error message is shown to the end-user (the employee in this case).
Since you want to go in a different direction for each value of the enumeration, you only need to use the attribute containing the enumeration. So the expression in this example is $MeetingRegistration/WorkingLocation
.
Afterwards, you can merge the three flows followed by a meeting URL into one flow (for more information, see Merge). Then you only need to commit the registration once and have one Close page activity after the merge.
Rule Section
The Rule section is shown in the decision properties pane if the Decision Type property is set to Rule. A rule can be selected to define the condition of the decision. You can use the outcome of the rule for the decision instead of calling a sub-microflow and using the returned variable of that sub-microflow.
The properties of the Rule decision type are the following ones:
-
Rule – allows you to select a rule.
-
Parameter – for each parameter of the rule an argument needs to be specified using expressions. For example, a rule that determines whether a customer deserves a certain status will have a customer object as a parameter.