Creating Conditional Statements

About this task

Conditional statements are used to branch processing within a Process, based on the result of a previous Process step. For example, when a Process performs a file copy, a conditional statement can test if the copy was successful. If the copy was successful, the Process continues processing subsequent statements. If the copy was unsuccessful, the Process can call a user-defined program that sends an error to the console operator and stops processing.

Conditional statements test against the completion code of a previous step. Conditional statements can be nested so that a Process can test for multiple results and react accordingly.

This procedure shows how to create a simple conditional statement that tests if a copy was successful. If the copy was successful, the Process executes the next statement. If the copy was not successful, the Process executes a Run Task that calls another program.

Procedure

  1. Use the Process Builder to create a new Process (see Creating a Process Statement).
  2. Create a Copy statement and label it STEP1 (see Creating a Copy Statement).
  3. From the Process Builder Summary page, select If and to access the Process Builder If Statement page.
  4. Type a label for the If step.
  5. Select the label that you want to test against from the list box (STEP1 in this example).

    You can also type the name in the Label field, if you have not created the label yet.

  6. Select GT (greater than) from the Operator field.
  7. Select 4 from the Value field.
  8. Click to return to the Process Builder Summary page.

    The If statement is added to the Process. Note that Process Builder appends Then to the end of the statement.

  9. From the Process Builder Summary page, select Run Task and to access the Process Builder Run Task Statement page.
  10. Create a Run Task statement that calls another program (Creating a Run Task Statement).
  11. Click to return to the Process Builder Summary page.
  12. Select Endif and .

    The conditional statement is completed. You can continue adding other statements as necessary to continue processing.