Create expressions with functions and operators to handle data and logic in flow
services.
About this task
Create a complex expression for checking the vaccination slot availability with the following
conditions.
- The location is Washington
- Postal code is 20010
- The vaccine can be either Pfizer, Moderna, or Sputnik
- Age is less than or equal to 45 and a slot is available
- The venue is Howard University Hospital
Procedure
- Go to Flow services.
- Select the project where you want to create the new flow service. You can also create a
new project.
- Click Add icon to create a flow service. The Start
creating the flow service page appears.
- Provide a name for the flow service. For example,
GetVaccinationSlotStatus and an optional description for the new flow
service.
- Select a conditional control in the flow service step. For example,
If.
- Click the Expression icon on the conditional flow service step.
The Expression Editor screen appears.
- Complete the following steps to define a rule:
- Select a left operand.
- Select an operator.
- Select a right operand. The rule is defined.
- [Optional] Click Add icon or Add Rule. A
new rule step is added.
- Repeat the preceding steps to define more rules as your requirement.
- Select the operator (group-level) from the And drop-down menu to
conjunct the previous and new rules. As per the example, rule 2 - postal code is
20010 defined and both are combined with an And
operator.
Complete the following steps to define a group:
- Click Add Group. A new rule step appears and is grouped under a separate
block.
- Select the operands and operator to define the rule.
- [Optional] Click Add icon or Add Rule
(group-level). A new rule step is added to the group.
- [Optional] Select the operator from the And drop-down list (group-level)
to conjunct the previous and new rules in the group.
- Repeat the preceding steps to define all rules in the group. The sub condition is defined.
As
per the example, group 1 - Vaccine can be either Pfizer, Moderna, or Sputnik, group 2 - Age is less
than or equal to 45 and slot exists* are defined as follows. The groups and other rules are combined
with an And operator.
- Define the rule 3 - Venue is Howard university hospital as per the example.
- [Optional] Complete the following steps to remove a rule or rule group:
- [Optional] Complete the following steps to negate a rule or rule group.
- Rule - Click
next to the rule that must be negated. The rule is deleted from the complex
condition.
- Rule Group - Click Negate Group in the group that
must be negated. The rule group is deleted from the complex condition. The button is renamed as
Remove Negation and helps you to remove the negation for that group.
- Click close on the Expression Editor page.
The condition is added to the flow service step. You can click the down and up arrows in the flow
service step to view and hide the complete expression.
The complex condition is created and you can proceed with the other flow service steps.