A business rule typically consists of the following information,
in the order specified:
- Definitions
- Conditions
- Actions
- Definitions
- At the beginning of the rule, you can set parameters that identify
business terms by using easily understandable names. You can set these
parameters by using the New Decision Service wizard.
For more information, see Creating business rules.
When
you specify the parameters, either by using the New Decision
Service wizard when you create the decision service, or
by adding them later in the Decision Service editor, you can then
refer to those parameters from all the rules in the .rules file.
If you create a parameter in the definitions section of a specific
rule, that parameter is available to that rule only.
Here is
an example of a definition:
definitions
set minimum_cart_value to $1500
- Conditions
- The conditions section of the rule contains the "if" statements.
These statements define the conditions under which actions are completed.
If the condition is true, the action is completed. A rule can contain
one or more condition statements.
Here is an example of a condition
section that contains two condition statements.
if
the customer's category is Gold
and the value of the customer’s shopping cart is more than minimum_cart_value
The second condition statement uses the variable that
was set in the definitions section. The action is completed if both
statements are true.
- Actions
- The actions section of the rule contains the "then" statements.
These statements define the actions that are taken when the conditions
that are represented by the "if" statements are met. If the actions
section contains more than one action, the actions are taken in the
order in which they are written. You can also include "else" statements
in the actions section. These statements define what actions to take
if the conditions are not met.
Here is an example of an action statement:
then
change the customer's category to Platinum
For a detailed reference guide to the Business Action
Language (BAL), which is used to author rules in
IBM® Integration Bus, see
IBM Operational Decision Manager product documentation.
For an example of how rules and parameters relate to a schema,
see Example rules that are created from a message instance and schema.