Decision Table Example

Let's start by taking a look at a simple non-programming example of multiple conditions and actions to determine "What to do today?"

A single condition/action relationship like "If it is raining then wear your raincoat" is easy to understand and represent in a process but when multiple conditions and actions are involved, the rule-set can get complicated. A decision table helps to simplify and organize logic.

Figure 3

This is an example of a limited entry table. A limited entry table can only use yes/no condition entries. The condition entry values are "y" for yes and "n" for no. The expanded view means that every possible yes/no combination of conditions are displayed in the condition entries. The combinations of condition and action entries in a column in this example form a Simple Rule. The action entry value in this example is "1" to denote the selected action. There are two types of rules: simple and complex. A simple rule contains either y or n in a condition entry. A complex rule can have a dash in a condition entry. A complex rule is described in the next section, Simplifying Structural Rules.

The example above has eight simple rules because the matrix provides each of the three conditions with two possible values. Therefore the total number of rules in this example is (2*2*2) = 8.