Overview: Ways to express business rules

You write business rules in action rules, decision tables, and decision trees by using the Business Action Language (BAL). To make multiple rules with the same structure, you can create templates that users complete to make new rules.

The BAL provides a simple if-then syntax that you use with a vocabulary to write business rules. The BAL defines the syntax and provides constructs for expressing business rule conditions and actions, and the vocabulary defines the terms that you use in the business rules.

Modifiable building blocks make up the business rules. The building blocks represent vocabulary elements, ruleset parameters, ruleset variables, and BAL constructs and operators. For example, in the following action rule statement, the building block the current load uses a business term from the vocabulary, is more than is a BAL operator, and 5000 is a value:

if
  the current load is more than 5000

A phrase in a business rule can use a business term. For example, to complete the following phrase, you must select the business term <a customer>:

the age of <a customer>

When you use the classic rule engine, it translates the BAL into the ILOG® Rule Language (IRL). You write technical rules and functions in IRL. For action rules, the translation maps the action rules to IRL. In decision tables, rows form the rules, and in decision trees, nodes define the rules. For an example of this more complex mapping, see Decision table to IRL mapping.

You can create and maintain business rules in Rule Designer or Decision Center. You can deploy the business rules through classic rule projects and decision services.

Operational Decision Manager provides various ways to express business rules:

Action rules

Action rules are sentence-like statements that express a set of conditions followed by the actions to take if the conditions are true. With action rules, you can state business policies in a predefined business vocabulary that a computer can interpret.

For example, you might state the policy change customers in the Gold category to the Platinum category when they spend more than $1,500 in a single transaction as follows in an action rule:

If
   All of the following conditions are true:
      - the customer category is Gold
      - the value of the shopping cart is more than $ 1,500
Then
   Change the customer category to Platinum

In an action rule, you can use all the BAL constructs and operators, and all the elements in the vocabulary.

You can find these elements in the following figure:

  • BAL construct  1 

  • Implicit variable  2 

  • Term  3 

  • Phrase  4 

  • Number value  5 

  • Rule variable  6 

  • BAL operator  7 

  • Constant  8 

  • Arithmetic operator  9 

  • Text value  10 

Action rule shows elements of the vocabulary, and BAL constructs and operators

Decision tables

Decision tables represent decision logic as a table. Each row in a decision table corresponds to an action rule.

The rows and columns of the tables show the possible situations that a business decision might encounter, and specify which action to take in each situation. You use decision tables to view and manage large sets of action rules with identical conditions.

As shown in the following decision table, you can see business terms, navigation phrases, BAL operators  1 , and action phrases  2  when you edit the condition columns. You can see constants  3 , number values  4 , and text values  5  in the cells of the table.

Decision table shows phrases and BAL operators, values, and constants

Decision trees

Decision trees graphically represent decision logic. In a decision tree, the branches represent conditions, and the leaves represent the actions to take if the conditions are true.

Decision trees provide the same function as decision tables. However, with decision trees, you can manage a large set of rules with some common conditions, but not all.

When you edit branches in a decision tree, you can see business terms, phrases, BAL operators, values, and constants. The following diagram shows values  1 , and constants and action phrases  2 :

Decision tree shows values and action phrases

Technical rules

You write technical rules in IRL, which is similar to Java™ code. You use technical rules to represent specific loops in the action part of your rules.

In the following example, the technical rules contain IRL keywords  1 , BOM elements in their code form  2 , values  3 , and constants  4 .

Technical rule shows IRL keywords, BOM elements, values, and constants

Simplifying rule editing for business users

When you design a rule project in Rule Designer, set up management and rule authoring environments that meet the needs of your business users. You want to avoid differences between the system architecture and the needs of business users.

For example, rule packages can reflect decision points in your application, but not the geography to which the business rules apply. The business rule vocabulary is ultimately implemented as an object model. The constraints that are involved in developing an object model can result in a verbose vocabulary. For example, your model might contain inheritance relationships or utility classes that business users cannot understand. You can hide these classes in the business object model.

You can also use action rule templates and decision table templates to help users create rules more easily and efficiently. A template is a partly completed action rule or decision table that the users uses to create a series of rules with the same structure.

Tip:

If you find that you use templates to manage many rules with shared conditions and actions and you modify only values, consider managing these rules as a decision table.

Filtering the vocabulary with categories

When you have a large vocabulary, you can use categories to filter the terms and phrases that are available to you when you edit rules in Rule Designer or Decision Center. When a category is assigned to a business rule, only the vocabulary terms and phrases of that category are visible in the business rule.

Adding custom properties to rule artifacts

To add properties to existing types of rule artifacts, you must extend the rule model. You can set up BAL and rule model extensions, and then deploy them to both Rule Designer and Decision Center. For example, to identify the country for which a rule is applicable, you can create a property that is called geography.

Business users can use custom properties to manage business rules. For example, they can use queries in Decision Center to set up views that are based on a property. With these views, business users have a different view of the rule project that is compared to the physical rule package organization that you set up in Rule Designer.