Authoring the decision logic

The decision logic that drives each decision can be expressed with business rules and decision tables.

Business rules

A rule defines the specific actions to take when certain conditions are met. A basic rule uses an if-then statement to associate a condition (if) with an action (then).

The rule states what action to perform when a condition is true, for example:

if
	the credit score is less than 200
then
	set decision to "Loan rejected: credit score too low.";

You write rules in the rule language, which is easily understood because it approximates natural language. The rule editor helps you to write rules by providing an automatic completion mechanism to select the constructs and statements that make up the rule.

For more information about the rule language that is used to write rules, see Rule language.

Decision tables

A decision table groups rules that have similar conditions and actions. A decision table contains rows and columns that work together to form rules.

In the following table, each numbered row expresses a rule. The columns define the conditions (Grade and Amount of loan) and actions (Insurance required and Insurance rate) of the rules in the table.

Decision table
Figure 1. An example of a decision table

If the conditions in a row are met, the rule that is formed by the row performs the actions in the row.

The decision table editor helps you easily add rows to the table and enter values in their cells to create new rules. You can also define preconditions that apply to all the rules in a table. Error markers help you find overlaps and gaps in your rules.

Warnings for overlaps and gaps

When you edit decision tables, you might receive overlap and gap warnings. Warnings are displayed for the following reasons:

  • Overlaps

    When two cells in a column contain ranges that include the same values. For example, the ranges [200,000; 300,000] and [200,000; 600,000] both include the numbers 200,000 - 300,000.

  • Gaps

    When two cells in a column contain ranges that do not include values between the ranges. For example, the ranges < 100,000 and [200,000; 600,000] do not cover the numbers 100,000 - 200,000.

Overlaps and gaps do not prevent a decision table from working. However, they might produce incorrect results.


Parent topic:

Creating decisions