Columns
Each column in a decision table represents a condition or an action.
The columns in a decision table hold the conditions and actions of the rules in the table. The top cell of each column identifies the object of a condition or the target of an action.
| Row | Grade | Amount of loan | Insurance required | Insurance rate | |
|---|---|---|---|---|---|
| Min | Max | ||||
| 1 | A | < 100,000 | false | ||
| 2 | 100,000 | 300,000 | true | 0.001 | |
Each numbered row in the table forms a rule. The rule does the actions in its row when the conditions in the same row are met. For example, the second row in the example states the following rule:
if
all of the following conditions are true:
- the loan grade is A
- the amount of the loan is between 100000 and 300000
then
set the Insurance required to true
set the Insurance rate to 0.001
Condition operators
You can split a condition across columns in a decision table when a rule statement contains more
than one value. For example, the following condition requires you to specify values for <min> and <max>:
if the age of the customer is between <min> and <max>
In condition columns, you set a default operator for all the cells. You can change this operator
for certain cells if you need to. The number of parameters depends on the operator, so columns with
different operators might show a different number of subcolumns. For example, the Age
condition column might have been defined with the is
between operator, which takes two parameters, to define different age ranges. In the third
row, the operator is more than is used to cover the
remaining values over 40, and this operator takes only one parameter.
| Age | |
|---|---|
| Min | Max |
| 18 | 25 |
| 26 | 40 |
| > 40 | |