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.
Before you begin
To perform this task, you must be in the IBM® Process
Designer desktop editor, which is deprecated.
About this task
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:
- Open the Process Designer desktop editor (deprecated).
- Open a process application that contains a business process definition (BPD).
- In the BPD diagram, click the decision gateway icon to select the decision gateway where you
want to attach the Decision service.
- Click the Properties tab.
- Click Decision.
- In the Decision Service section,
click Select.
- Select the Decision service you want to attach to the gateway
from the list of available services.
- 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.
- 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.
- To select an input variable statement, click the variable
icon
to display
a list of available variables.
- The Inputs section includes an auto-map function. To
create a mapping between the variables used in the Decision service
and the variables that are used in the main business process definition,
click the auto-map icon
. When
developing processes in IBM Business
Process Manager, 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.
- Click Implementation in the Properties
tab.
- 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.
- 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.
- 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: In
this screen capture, the input variable tw.local.notification.message in
the top position is set to no message as output; that is, no text
will be sent as indicated by the quotation marks with no text inside
(""). This output would be determined by the logic of the decision
service. Under a certain set of conditions, no message would be sent.
For example, if the decision service checked a database and found
that the customer no longer existed it would not send a message. Another
possibility might be that the customer had an invalid email address,
so no message would be sent.The input variable and its output in the
bottom position are hidden in this screen capture; however, by using
the arrows you could move the bottom position up to the top position
and the code would be displayed. This is the default output, which
is to send a message. The message sent as output could be in quotation
marks, for example, "Your order is confirmed," or the message sent
as output might be in an another variable such as orderConfirmationNumber,
which would contain the order number for something the customer had
ordered.