Prev | Next |
DMN Decision Table Validation
Decision table is one of the most common and powerful DMN Expressions to express the decision logic. However, modeling a Decision table could also be complicated, especially multiple input clauses have combination for many decision table rules. Luckily, EA provided the feature to validate a decision table.
In this topic, we will show the user how to validate a DMN Decision Table.
Access
DMN Expression Window |
Simulate > DMN > Manage > DMN Expression, then click the |
DMN Simulation Window |
Simulate > DMN > Manage > Open DMN Simulation > Configure page, then click the |
Entries out of range detection
It is a good practice to define "allowed values" for input clause and output clause of a decision table.
Firstly, the enumerations (comma separated string) will enable the Auto Completion feature, where the user can choose the value from a list rather than typing them in the entry field.
Secondly, the "allowed values" enables EA to perform a range check for the entry values.
In this example,
the "Age" input Clause defined a range of [20..120], caused the first rule [18..21] fail.
The Marital Status defined a enumeration "S, M", caused the rule #7 with value "D" fail.
The user may fix this issue by changing the "allowed value" range or the rule entry, based on the actual business rules.
Completeness detection – report gaps in the rules
The gaps in rules for a decision table means that given a combination of input values, no rule is matched. This indicates that some logic/rule may missing (unless a default output is defined).
When the decision table defined rules with lots of number ranges, it is hard to detect gaps by either eye sight and too hard to compose test cases.
For example,
The validation reports a gap in the rules, the user may first perform a merge on the decision table to focus on the 3rd input "Credit Score" and easily detect the error in input entry (580..600], which should be [580..600].
Rule Overlaps detection for Unique Hit Policy
When rules overlap, given a combination of input values, multiple rules are matched. This is a violation if the decision table specifies Unique as hit policy.
When the decision table defined rules with lots of number ranges, it is hard to detect gaps by either eye sight and too hard to compose test cases.
For example,
The validation reports an overlap in the rules, the user may first perform a merge on the decision table to focus on the 3rd input "Credit Score" and easily detect the overlap between "<610" and "[600..625]". The user may fix this issue either by changing rule #4 to "<600" or by changing rule #5 to "[610..625]", based on the actual business rules.
Learn more