IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Building services > Building a Decision service

Attaching a Decision service to a decision gateway

You can use a decision gateway in your business process definition (BPD) when you need to model a point in the process execution where only one of several paths can be followed, depending on a condition.

You can also attach a Decision service to a decision gateway.

When you attach a Decision service to a decision gateway, the process follows a specific sequence line coming out of the gateway based on the result of the conditions and actions in the rule components in the Decision service. If there are multiple decisions in the Implementation properties for the gateway, the decisions are evaluated from top to bottom and the path for the first decision that evaluates to true is followed. If no decisions evaluate to true, the default path is followed.


Procedure

To attach a Decision service to a decision gateway, complete the following steps:

  1. In the business process definition diagram, click the decision gateway icon to select the decision gateway where you want to attach the Decision service.

  2. Click the Properties tab.

  3. Click Decision.

  4. In the Decision Service section, click Select.

  5. Select the Decision service you want to attach to the gateway from the list of available services.

  6. If you decide not to use an existing Decision service, you can create a new service. Click New next to the Service field. You can remove an attached Decision service from a decision gateway. Click the delete icon (X) next to the Decision service name.

  7. The Inputs section contains a variable condition statement field that controls the behavior of the gateway, based on the result of the rules in the rule component.

    1. To select an input variable statement, click the variable icon to display a list of available variables.

    2. The Inputs section includes an auto-map function. To create a mapping between the variables used in the Decision service and the variables used in the main business process definition, click the auto-map icon .

      When developing processes in IBM BPM, you must set the input and output mapping for each activity included in a business process definition so that the variable values received and generated by services map to the variables from the main process definition. For more information about the auto-map function, refer to the related topic "Mapping input and output data for an activity."

    The text field under the Inputs heading shows the JavaScript object that represents the variable. The variable name is displayed to the right of the Inputs field.

  8. Click Implementation in the Properties tab.
  9. Under the Decisions heading, add a variable statement to each decision to control the output of the decision gateway. The last decision is the default condition sequence line, which is followed if none of the decisions evaluate to true. You can change the position of a decision. Click the down arrow or the up arrow next to a decision to move it down or up in the decision list.

  10. For each decision above the last (default) decision, add an output variable statement. Click the variable icon to display a list of available output variables that are defined in the Decision service. The text field for each decision shows the JavaScript object that represents the variable condition.

  11. To enable the process to process the decision and choose the correct output sequence line for the decision gateway, you must also specify a comparison function and a value for each decision.

    For example, if the purpose of the decision gateway is to determine whether a notification message is sent to a customer or not, then the decisions are No Notification (the process ends with no message sent), or Send Notification. The value of the No Notification decision is null, because the rules in the decision service have determined that no notification message is required. The value of the Send Notification decision is determined by variables that are defined in the rules. In this example, Send Notification is the default decision. The example decisions are illustrated in the following figure:

Building a Decision service


Related tasks:
Scenario: Creating a Decision service in a Personalized Notification process
Mapping input and output data for an activity