Prev | Next |
Decision Table Validation
A Decision Table is one of the most common and useful DMN Expressions used to express decision logic. However, modeling a Decision Table can also be complicated, especially if multiple Input Clauses are used in combination for many Decision Table rules. Enterprise Architect provides the facility to validate Decision Tables, as explained in this topic.
Access
DMN Expression Window |
Simulate > Decision Analysis > DMN > DMN Expression : |
DMN Simulation Window |
Simulate > Decision Analysis > DMN > Open DMN Simulation > Configure : |
Entries out of range detection
It is good practice to define 'allowed values' for the Input Clauses and Output Clauses of a Decision Table. The 'allowed values' list is used to perform range-checking of the input and output entry values for the table rules.
In this example:
- The 'Age' Input Clause defines a range of [20..120]; however, the input entry for rule 1 specifies a range of [18..21]; this is outside the range of allowed values, so rule 1 is reported as invalid
- The 'Marital Status' clause defines its allowed values as an enumeration of 'S, M'; rule 12 specifies a value of 'D', hence that rule is also reported as invalid
These issues can be corrected, either by updating the 'allowed values' or by modifying the input entries for the invalid rules, depending on the actual business rules.
Completeness detection - report gaps in the rules
The gaps in rules for a Decision Table mean that, given a combination of input values, no rule is matched. This indicates that some logic or rule might be missing (unless a default output is defined).
When the Decision Table contains many rules that specify number ranges, it becomes difficult to visually detect gaps and quite time-consuming to compose and run exhaustive test cases.
For example:
The validation reports a gap in the rules. Closer inspection reveals an error in rule 9. The input entry (580..600], should be [580..600].
Rule Overlap detection for Unique Hit Policy
When rules overlap, for a given combination of input values, multiple rules are matched. This is a violation if the Decision Table specifies its Hit Policy as 'Unique'.
When the Decision Table contains many rules that specify number ranges, it becomes difficult to visually detect gaps and quite time-consuming to compose and run exhaustive test cases.
For example:
The validation reports an overlap in the rules, involving rules 4 & 5. Closer inspection reveals the overlap exists in the third input 'Credit Score', where '<610' overlaps with '[600..625]'. You could correct this issue either by changing rule 4 to '<600' or by changing rule 5 to '[610..625]', to reflect the actual business rules.