Implementing a conditional activity

Follow these steps to implement a conditional activity.

Procedure

  1. Open a business process definition (BPD) in the Designer.
  2. In the BPD diagram, click the activity that you want to make conditional.
  3. Click the Condition tab in the properties, and then select the Is Conditional option. The activity in the BPD diagram now includes a diamond-shaped icon to indicate that it is conditional.
  4. Select the conditional activity for execution using one of the following options:
    Option Description
    JavaScript Enter JavaScript in the available text box that returns a valid Boolean (true or false) value. If the runtime return value of the supplied script is true , the activity is performed.
    Note: If a script is present in the text box, it overrides any human decision at run time to perform or skip the activity.
    Set selected conditional activities If the Is Conditional option is enabled and no JavaScript is entered in the available text box, the activity is performed only if previously selected. Use the tw.system.process.selectedConditionalActivities property to set selected conditional activities.
    Note: If necessary, you can build a graphical user interface (Coach) that enables users to select the conditional activities to be performed as described in the following table. The conditional activity sample available in [IBM_BPM_home]\imports\conditional-activity-sample.twx includes a Coach that demonstrates this type of implementation.
    Note: IBM® Business Process Manager Performance Data Warehouse records data that enables you to perform analysis on conditional activities. When a conditional activity is skipped, a tracking point is created with SKIP appended to the name of the skipped activity. A tracking point is created in the Performance Data Warehouse TRACKINGPOINT views each time an activity is skipped. Using this data, you can generate reports to show which activities are skipped and how often those activities are skipped in a process instance.