Creating complex expressions

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

  1. Go to Flow services.
  2. Select the project where you want to create the new flow service. You can also create a new project.
  3. Click Add icon to create a flow service. The Start creating the flow service page appears.
  4. Provide a name for the flow service. For example, GetVaccinationSlotStatus and an optional description for the new flow service.
  5. Select a conditional control in the flow service step. For example, If.
  6. Click the Expression icon on the conditional flow service step. The Expression Editor screen appears.
  7. Complete the following steps to define a rule:
    1. Select a left operand.
    2. Select an operator.
    3. Select a right operand. The rule is defined.
  8. [Optional] Click Add icon or Add Rule. A new rule step is added.
  9. Repeat the preceding steps to define more rules as your requirement.
  10. 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.

  11. Complete the following steps to define a group:

    1. Click Add Group. A new rule step appears and is grouped under a separate block.
    2. Select the operands and operator to define the rule.
    3. [Optional] Click Add icon or Add Rule (group-level). A new rule step is added to the group.
    4. [Optional] Select the operator from the And drop-down list (group-level) to conjunct the previous and new rules in the group.
    5. 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.

  12. Define the rule 3 - Venue is Howard university hospital as per the example.
  13. [Optional] Complete the following steps to remove a rule or rule group:
    • Rule - Click Delete icon next to the rule that must be deleted. The rule is deleted from the complex condition.
    • Rule Group - Click Remove Group in the group that must be deleted. The rule group is deleted from the complex condition.
      Tip: You can use the keys Ctrl+Z and Ctrl+Y to undo and redo the delete actions.
  14. [Optional] Complete the following steps to negate a rule or rule group.
    • Rule - Click Negate rule 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.
  15. 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.