Tour: Editing expressions with the Expression Editor

This part of the tour uses an example to show how to edit expressions with the Expression Editor.

About this task

Depending on which expression fragment you want to edit, different edit actions are available in the edit actions section. The prototype expressions section changes depending on the edit action that you choose.

Procedure

  1. Select the expression fragment IBMAfuArchiveTrigger in the expression tree.
    The default action is Edit and the Prototype section is replaced with an Edit section, where you can enter or edit expression values.
  2. Select the edit action Replace to replace the selected expression fragment with another prototype expression.
    Only those expressions are available in the Prototype Expression section that have the same data type as the selected fragment, in this example a literal.
  3. Click the Add(String, String) expression.
    In the description field, you can now read what the expression does.
  4. Double-click the selected Add(String, String) expression to update the expression tree with the Add operator.
    The expression fragment IMBAfuArchiveTrigger is replaced with the Add operator.
  5. Click the first fragment of the operator to edit the literal.
  6. Type IBMAfu into the Edit field.
  7. Select the next fragment to define the second part of the literal.
  8. Type ArchiveTrigger into the Edit field.
  9. Click the Add operator in the expression tree to update the expression fragments.
  10. Click the <Email, Message Form> fragment in the expression tree.
    This expression fragment is a metadata reference. Metadata references specify the property of a system or user-defined metadata source or an element in a list.
  11. Select the edit action Edit.
    The Edit section for a metadata value is different than for a literal value.

    Different document sources create different formats, each with properties specific to its type.

    When you choose a specific metadata source, you are narrowing the properties that are available to just those for that source. Therefore, when you select a metadata source, you are choosing the kind of properties that will be available during processing.

  12. Click the Expand button in the Edit section to expand the test interface.
  13. Type IBMAfuArchiveTrigger into the test value field.
    This simulates a value for the metadata.

    In this example, the expression checks if the first operand, the result of Add, is equal to the second operand, the value of the metadata <Email, Message Form>. This means that the rule returns TRUE if the message form metadata contains the value IBMAfuArchiveTrigger, thus the email document is a trigger email.

  14. Click the Test entire expression button in the toolbar.
    The test result is TRUE, so if the metadata value is IBMAfuArchiveTrigger, the expression evaluates to TRUE. If you change the test value, the expression evaluates to FALSE.
  15. Select the root expression and click the Save button, enter a name for the expression, for example IEqual.expr, and click Save.
    For cases where the rule returns FALSE, we can now easily define another path in the task route on the basis of the first rule. This second rule named No Trigger Email is a negation of the rule Trigger Email.
  16. Close the Expression Editor.
  17. Select the No Trigger Email rule in the design pane and launch the Expression Editor to update the rule.
    The No Trigger Email rule is very similar to the Trigger Email rule. It negates the result by using a Not operator as root expression.
  18. Select the IEqual element that you want to replace with your saved expression.
  19. Click the Replace button in the toolbar to replace the selected expression fragment.
  20. Select the previously saved template and click Open.
    The template replaces the selected expression fragment.
  21. When you have finished editing or configuring your expression, click OK to save your changes, or Cancel to close without saving.