To Write Conditional Rules

You can insert conditional statements into rules by using the drop-down lists in the iLogic Edit Rule dialog. (You can also enter the text manually.)

When you enter the actions to perform, you can use the choices in the Snippets area of the Edit Rule dialog to insert a function. You can then add the appropriate arguments for the function.

Display the Edit Rule Dialog

  1. On the ribbon, click Manage tab iLogic panel iLogic Browser if the browser is not currently displayed.
  2. In the iLogic Browser, do one of the following:
    • Right-click an empty area and select Add Rule.
    • Click the Rules tab or the External Rules tab, right-click a rule, and select Edit Rule.

Perform Alternate Actions for True or False Conditions

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Replace My_expression with the first expression to evaluate.
  4. Enter the action to perform if the condition is true, on the line between the If-Then statement and the EndIf statement.
  5. Leave your cursor at the end of the action you just entered, and select Else from the drop-down list.
  6. Enter the action to perform if the condition is false, on the line between the Else statement and the EndIf statement.

Perform Action Only If One Condition Is True

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Replace My_expression with the expression to evaluate.
  4. Enter the action to perform if the condition is true, on the line between the If-Then statement and the EndIf statement.

Perform No Action for Condition

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Position the cursor between the two inserted lines, and select Else from the drop-down list.
  4. Replace My_expression with the expression to evaluate.
  5. <recommended> Enter a comment, such as ‘do nothing, to replace what would normally be an action in the statement.
    • Enter the comment at the end of the If-Then statement to perform no action if the condition is true.
    • Enter the comment after the Else statement to perform no action if the condition is false.
  6. Enter the action to perform for the true or false condition, depending on which condition is to include the action.

Perform Alternate Actions for More Than Two Conditions

  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select If...Then...EndIf from the drop-down list in the toolbar.
  3. Replace My_expression with the first expression to evaluate.
  4. Enter the action to perform for the condition, between the two lines.
  5. With the cursor at the end of the action you just entered, select ElseIf...Then from the drop-down list, and replace My_expression with the next expression to evaluate.
  6. Enter the action to perform for this condition, on the blank line below the condition.
  7. Repeat the previous two steps as many times as necessary to accommodate the remaining conditions.

Perform Alternate Actions Based on Comparison to Test Case

Select Case <test expression>
Case <expression list 1>
<statement list 1>
Case <expression list 2>
<statement list 2>
Case Else
<statement list n>
End Select
  1. Position the cursor at the desired location in the rule text area of the Edit Rule dialog box.
  2. Select Select Case from the Keywords drop-down list in the toolbar.
  3. Add a space at the end of the statement you inserted, and then enter the test expression.
  4. Press Enter, and select Case from the Keywords drop-down list in the toolbar.
  5. Add a space at the end of the statement you inserted, and then enter the first expression to compare against the test expression.
  6. Enter the action to perform for this condition, on the blank line below the expression.
  7. Repeat the previous two steps as many times as necessary to accommodate each expression.
  8. Position the cursor on a blank line below the last expression, and select Case Else from the Keywords menu.
  9. On the blank line below the statement you inserted, enter the final Case clause to trap unexpected results, and press Enter.
  10. Position the cursor on a blank line below the last expression, and select End Select from the Keywords menu.