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:
- In the Studio, go to the process design editor.
- 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 hard
to see.
- 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.
- 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.
- 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,
Conditional is selected, because this is a
conditional transition.
- 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.
- Click
OK.
The expression is set.
- 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.