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:
- 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.
- Right-click on the Check Company Policy automatic activity,
and click
(
).
Your mouse cursor will begin dragging a transition line.
- Click on the Confirm Receipts interactive activity.
The
Transition from Activity dialog box appears.
- 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.
- 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.
- 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
- Drag the Review Report activity back to its original
location.
- Right-click on the Accepted and Preapproved transition.
The
Transition from Activity dialog box appears.
- Select the
Properties tab.
Note that in the
Type drop-down list,
Condition is selected, because this is a
condition transition.
- 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.
- Click
OK.
The condition expression is set.
- 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.