Associating a Script with a Conditional Flow
Scripts are associated with a Conditional Sequence Flow by entering the script in the Properties view for that Sequence Flow object. You can use a script to define the conditions that determine whether a conditional sequence flow is followed.
- Procedure
- Create the Conditional Sequence Flow object. On the General tab of the Properties view, note that the Conditional button is selected by default.
- In the Script Defined As list, select JavaScript.
- Enter the script in the
Describe Sequence Flow Condition
area. The script can be a multi-line script and the result of the last statement of the script should be of Boolean type and that determines the result of the script. This is an example of a simple script:
This is an example of a more complex script:
Note: On the General tab, there might already be a text description of the required script. This description is converted to comments if you select JavaScript from the Script Defined As list. If you select Unspecified from the Script Defined As list, the description is lost. However, you can recover the description by pressing Ctrl+Z.