Adding a Conditional Transition

The instance is routed through a conditional transition when a given condition is met. Here we will add a conditional transition so that the report skips the approval activity if the total amount is low.

To add a conditional transition:

  1. In the Studio, go to the process design editor.
  2. Right-click on the Check Company Policy automatic activity, and click Add conditional transition (Conditional Transition icon 
				). Your mouse cursor will begin dragging a transition line.
  3. Click on the Confirm Receipts interactive activity. The Transition from Activity dialog box appears.
  4. Enter Accepted and Preapproved in the Name field, and click OK. The transition is added to the diagram. However it is hard to see.
  5. We will make this transition a curve. To be able to select it, first drag the Review Report activity down (we will move it back later). You should now be able to see the Accepted and Preapproved transition.
  6. Click on the arrow of the transition and drag upwards. Note how it becomes an arc.
    Figure 1. Accepted and Preapproved Transition
    At this point, you should see something like the above in your process diagram.
  7. Drag the Review Report activity back to its original location.
  8. Right-click on the Accepted and Preapproved transition. The Transition from Activity dialog box appears.
  9. Select the Properties tab. Note that in the Type drop-down list, Conditional is selected, because this is a conditional transition.
  10. In the text box for the conditional transition expression, enter the following, exactly as shown:
    result == "Accepted" and report.isApproved == true
    

    This expression checks for the values set in the Check Company Policy activity, which you worked on in the previous task.

  11. Click OK. The expression is set.
  12. Save your changes.

After completing this task, your process design diagram should look like this:

Figure 2. Expense Report process with Accepted and Preapproved transition.