Decision Table
A Decision Table is a tabular data structure that represent business rules.
References
2015
- (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/decision_table Retrieved:2015-8-17.
- Decision tables are a precise yet compact way to model complex rule sets and their corresponding actions.
Decision tables, like flowcharts and if-then-else and switch-case statements, associate conditions with actions to perform, but in many cases do so in a more elegant way.
In the 1960s and 1970s a range of "decision table based" languages such as Filetab were popular for business programming.
- Decision tables are a precise yet compact way to model complex rule sets and their corresponding actions.
- (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/decision_table#Structure Retrieved:2015-8-17.
Conditions | Condition alternatives |
Actions | Action entries |
- Each decision corresponds to a variable, relation or predicate whose possible values are listed among the condition alternatives.
Each action is a procedure or operation to perform, and the entries specify whether (or in what order) the action is to be performed for the set of condition alternatives the entry corresponds to.
Many decision tables include in their condition alternatives the don't care symbol, a hyphen. Using don't cares can simplify decision tables, especially when a given condition has little influence on the actions to be performed.
In some cases, entire conditions thought to be important initially are found to be irrelevant when none of the conditions influence which actions are performed.
Aside from the basic four quadrant structure, decision tables vary widely in the way the condition alternatives and action entries are represented. [1] [2] Some decision tables use simple true/false values to represent the alternatives to a condition (akin to if-then-else), other tables may use numbered alternatives (akin to switch-case), and some tables even use fuzzy logic or probabilistic representations for condition alternatives. In a similar way, action entries can simply represent whether an action is to be performed (check the actions to perform), or in more advanced decision tables, the sequencing of actions to perform (number the actions to perform).
- Each decision corresponds to a variable, relation or predicate whose possible values are listed among the condition alternatives.
- (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/decision_table#Example Retrieved:2015-8-17.
- The limited-entry decision table is the simplest to describe. The condition alternatives are simple Boolean values, and the action entries are check-marks, representing which of the actions in a given column are to be performed.
A technical support company writes a decision table to diagnose printer problems based upon symptoms described to them over the phone from their clients.
The following is a balanced decision table (created by Systems Made Simple).
- The limited-entry decision table is the simplest to describe. The condition alternatives are simple Boolean values, and the action entries are check-marks, representing which of the actions in a given column are to be performed.
Rules | |||||||||
---|---|---|---|---|---|---|---|---|---|
Conditions | Printer does not print | Y | Y | Y | Y | N | N | N | N |
A red light is flashing | Y | Y | N | N | Y | Y | N | N | |
Printer is unrecognized | Y | N | Y | N | Y | N | Y | N | |
Actions | Check the power cable | X | |||||||
Check the printer-computer cable | X | X | |||||||
Ensure printer software is installed | X | X | X | X | |||||
Check/replace ink | X | X | X | X | |||||
Check for paper jam | X | X |
Of course, this is just a simple example (and it does not necessarily correspond to the reality of printer troubleshooting), but even so, it demonstrates how decision tables can scale to several conditions with many possibilities.