Before you begin
- Create a decision service by following the instructions in Creating a decision service.
- Write business rules by following the instructions in Writing rules.
Alternatively, you can import a rule application archive from IBM® Operational
Decision Manager by following the instructions
in Importing a rule application archive file. The imported rule application
archive is converted to a decision service (.rules file),
which you can use to configure the DecisionService node.
About this task
A decision service contains a set of business rules and
parameters. You can associate a decision service with a node in a
message flow. You can then pass a message through that flow, and the
business rules in your decision service are run against the message.
The
order in which you create your decision service and your
DecisionService node is flexible.
- If you open the New Decision Service wizard
from a DecisionService node,
the decision service that you create is associated with that node.
You can then use the node in a message flow to control operations
like routing, validation, and transformation.
- If you create the decision service from a menu option, or you
import a rule application archive from IBM Operational
Decision Manager, drag the decision service file
onto a DecisionService node
to configure the node. By creating the decision service first, you
can then use it with multiple message flows. You can also associate
an existing decision service with a node by using the Decision Service property of the
node.
The following steps describe how to associate an existing
decision service with a DecisionService node.
- Create a message flow and add a DecisionService node by dragging
it from the node palette onto the canvas. Select the node so that
you can set its properties.
- On the Basic properties tab, click Browse,
then navigate to the decision service that you want to use with this
message flow.
The Ruleset field
is populated automatically. If the selected decision service was created
in IBM Integration Bus, it contains a single
rule set. If the decision service was created from an imported rule
application archive, it can contain multiple rule sets. Select the
appropriate rule set to see its parameters.
A decision service
rule set can contain one or more parameters. Most parameter values
are read-only, except for the Data location value, where you must
enter an XPath expression.
If the parameters in the decision
service file change, an error message is shown in the Problems view
to indicate that the parameters on the node do not match the parameters
in the decision service file. To correct this error, reselect the
decision service file and the rule set on the node, and add an XPath
expression in the Data location field for each
updated parameter.
The direction of the parameters can be
IN, OUT, or INOUT. For decision services that are created in the IBM Integration Toolkit, only INOUT parameters are supported.
For decision services that are created by importing a rule application
archive from IBM Operational
Decision Manager, IN, OUT, and
INOUT parameters are supported.
The Verbalization column
contains a natural language name (or alias) for the parameter; for
example, "the customer". This value is used to refer to the parameter
when you write a rule. If the decision service was created by importing
a rule application archive, the verbalization value is not visible.
- Specify an XPath expression for each parameter. The
XPath expression specifies the location in the inbound message of
the data for each parameter; for example, $Root.
- Select a parameter and click Edit.
- In the Data location field, specify
an XPath expression. For help, open the XPath Expression Builder by
clicking Edit or pressing Ctrl+Space.
- Click OK.
- Optional: If you are using rules that were
created in IBM Operational
Decision Manager, you can retrieve
those rules at run time from an external repository. To connect to
an external repository, you must configure the DecisionServiceRepository
configurable service and select the node property Use DecisionServiceRepository
configurable service. For more information,
see Retrieving business rules at run time from an IBM Operational Decision Manager repository.
- When you complete your changes, save the message flow.
- Before you deploy your decision service ensure that you
have enabled decision services by using the mqsimode command.
mqsimode -x DecisionServices
For
more information, see Developing business rules.
- Deploy the application, library, integration
project, or flow that contains the
decision service.
For more information about deployment,
see Deployment rules and guidelines.
What to do next
When you are using your decision service to process messages,
you can monitor their behavior by using the activity log and resource
statistics. For more information, see the following topics:
For details of the data that you can capture for decision services,
see the following reference topics: