Adding a Condition Transition

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

To add a condition transition:

  1. In the Project Navigator, expand Processes and click Expense Report. in the right pane, the process design editor displays the notations for the Expense Report process.
  2. Right-click on the Check Company Policy automatic activity, and click Add conditional transition (Condition 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 hidden behind another transition and therefore hard to see.
  5. We will make this transition a curve. To be able to select it, first drag the Review Report activity left (we will move it back later). You should now be able to see the Accepted and Preapproved transition.
  6. Click on the middle of the transition and drag towards the upper right. Note how it becomes an arc. At this point, you should see something like the following in your process diagram.
    Figure 1. Accepted and Preapproved Transition
  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, Condition is selected, because this is a condition transition.
  10. In the text box for the condition 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 that you worked on in the previous task.

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

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

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