18.
Compact way to model large sets of related rules.
The state of a number of conditions determines the execution of a set of actions.
Many variations of the decision table concept exist which look similar at first sight.
19.
Agenda
Overview
Types
Validation & Verification
20.
Transformation
21.
Decision Tables in Guvnor
22.
Roadmap
23.
Summary
24.
Q&A
25.
Types
Types
Layout
Horizontal
26.
Vertical
27.
Limited entry
28.
Extended entry
Categorisation
Expanded form, contracted form
29.
Multi-hit, all hits
30.
Multi-hit, first hit
31.
Single hit
32.
Layouts
Horizontal
33.
Layouts
Vertical
34.
Layouts
Limited entry
35.
Layouts
Extended entry
36.
Categorisation
Expanded form
Single column for every condition combination
37.
The number of columns should equal the product of the number of states for every condition.
e.g. 3 conditions each with 2 states gives:
2 * 2 * 2 = 8 combinations
e.g. 2 conditions each with 3 states and 1 condition with 4 states gives:
3 * 3 * 4 = 36 combinations
38.
Categorisation
Expanded form (continued)
Condition states should be digitised
e.g. age: <18, 18-35, 36-60, >60 not a free-form integer field
Condition states should be continuous
e.g. GOOD: age<18, age>=18; BAD: age<18, age>=30
39.
Not essential for expansion but ensures completeness
This guarantee of completeness of condition combinations is one of the main advantages of decision tables.
40.
Categorisation
Expanded form (continued)
41.
Categorisation
Contracted form
Contraction is the first optimisation.
42.
Reduces the number of condition columns.
43.
If the same actions exist for rules covering all condition states for a given condition they can be combined and the condition state becomes irrelevant.
44.
Categorisation
Contracted form – stage 1 Rules 2 and 3 are impossible conditions
45.
Categorisation
Contracted form – stage 2 Merge adjacent column groups with identical action parts
46.
Categorisation
Multi-hit, all hits
To get complete result all rules matching need to have their actions executed.
47.
Condition columns are not mutually exclusive
48.
If the Condition columns are not exclusive, some combination of conditions are present in more than one column, which may lead to ambiguity or inconsistency.
49.
Categorisation
Multi-hit, all hits
Given a 35 year old with 15 years service 1. Rule 1 matches, giving 22 days 2. Rule 5 matches, giving an additional 3 days 3. A total of 25 days is assigned
50.
Categorisation
Multi-hit, first hit
To get complete result the first rule (from left-to-right) matching needs to have its action executed.
51.
Condition columns are not mutually exclusive.
52.
If the Condition columns are not exclusive, some combination of conditions are present in more than one column, which may lead to ambiguity or inconsistency.
53.
Categorisation
Multi-hit, first hit
Given a 35 year old with 15 years service 1. Rule 4 matches, giving 25 days 2. Rule 6 would match but Rule 4 was the first hit
54.
Categorisation
Single hit
Each possible combination of conditions matches exactly one, and only one, rule.
55.
Condition columns are mutually exclusive
56.
As the Condition columns are exclusive; combinations of conditions cannot be present in more than one column which eliminates ambiguity and inconsistency.
57.
Classic form if Single-hit is "expanded decision table"; but this can be optimised or “contracted”.
58.
Categorisation
Single hit
Given a 35 year old with 15 years service 1. Rule 3 matches, giving 25 days 2. No other rules match
59.
Agenda
Overview
60.
Types
Validation & Verification
Transformation
61.
Decision Tables in Guvnor
62.
Roadmap
63.
Summary
64.
Q&A
65.
Validation & Verification
Redundancy
66.
Ambivalence (conflicting)
67.
Deficiency
68.
Mitigation
69.
Validation & Verification
Redundancy
Duplication
70.
Subsumption
Two rules have the same actions, but one contains additional conditions in which it will succeed. Whenever the more restrictive rule succeeds, the less restrictive rule also succeeds, resulting in redundancy.
Impossible conditions
Conditions that do not make sense (e.g. age < 0)
71.
Validation & Verification
Redundancy - Subsumption
72.
Validation & Verification
Ambivalence
Contradictory rules
Two (or more) rules have the same conditions but with different actions.
Conflicting rules
An action for one rule is the opposite of the same action for the other rule.
Ambiguous rules
The actions are different but not opposite.
73.
Validation & Verification
Ambivalence
Premium is £500 if applicant age is less than 30
74.
Premium is £300 if Years Without Claim is greater than or equal to 10 years.
Applicant is 29, premium is £500
75.
Applicant has 12 years without claim, premium is £300
Applicant is 29 with 12 years without claim, premium is ?!?
76.
Validation & Verification
Deficiency
Missing rules
A situation exists in which a particular action is required, but there is no rule that succeeds in that situation and produces the desired conclusion.
Unused input state or domain attribute
77.
Missing knowledge
The absence of some essential elements from the problem situation.
78.
Validation & Verification
Mitigation – redundancy
Duplication
Cannot occur in the Single-hit decision table, because columns do not overlap.
Subsumption
Cannot occur in the Single-hit decision table, because columns do not overlap.
Impossible conditions
Impossible combinations may still exist.
79.
Validation & Verification
Mitigation - ambivalence
The single-hit table format avoids such conflicts.
Premium is £500 if applicant age is less than 30
80.
Premium is £300 if Years Without Claim is greater than or equal to 10 years.
Applicant is 29 with 12 years without claim, premium is £300
81.
Validation & Verification
Mitigation - deficiency
Missing rules
Expanded decision table is exhaustive
82.
All combinations of condition states are included
Unused input state or domain attribute
Expanded decision table is exhaustive
83.
All combinations of condition states are included
Missing knowledge
Validation of domain model by domain expert
84.
Agenda
Overview
85.
Types
86.
Validation & Verification
Transformation
Decision Tables in Guvnor
87.
Roadmap
88.
Summary
89.
Q&A
90.
Transformation
Decision Trees
Requirements
Digitised condition states
91.
Each Condition in a column becomes a branch
Multi-hit
Walk every path through tree
Single-hit
Walk single path through tree
92.
Transformation
Example - Decision Table
93.
Transformation
Example - Decision Tree
94.
Transformation
Paying attention?
95.
Rules 1, 2 and 3, 4 have the same action no matter what the state of “Hunger”. Therefore they can be contracted...
96.
Agenda
Overview
97.
Types
98.
Validation & Verification
99.
Transformation
Decision Tables in Guvnor
Roadmap
100.
Summary
101.
Q&A
102.
Decision Tables in Guvnor
What do we currently provide?
Vertical layout
103.
Generalised categorisation
Multi-hit, all hit; Multi-hit first hit; Single hit
Extended entry
104.
Digitised condition states (enumerated fields)
105.
New decision table editor
Foundation for future work
106.
Condition and rule negation
107.
Cell merging
108.
Cell grouping
109.
Decision Tables in Guvnor
What do we currently provide?
Cell merging
110.
Decision Tables in Guvnor
What do we currently provide?
Cell grouping
111.
Decision Tables in Guvnor
What do we currently provide?
Video demonstration
Demonstration available online at http://vimeo.com/21438537
112.
Decision Tables in Guvnor
Generation of DRL
113.
Each row compiles into a separate DRL rule
114.
Decision Tables in Guvnor
Generation of DRL
115.
Each row compiles into a separate DRL rule
116.
rule "Row 1 dtable"
117.
dialect "mvel"
118.
when
119.
$person : Person( age < "18" )
120.
then
121.
$person.setHolidayEntitlement( 27 );
122.
end
123.
rule "Row 2 dtable"
124.
dialect "mvel"
125.
when
126.
$person : Person( age >= "18" , age < "45" , lengthOfService < "15" )
127.
then
128.
$person.setHolidayEntitlement( 22 );
129.
end
130.
Agenda
Overview
131.
Types
132.
Validation & Verification
133.
Transformation
134.
Decision Tables in Guvnor
Roadmap
Summary
135.
Q&A
136.
Roadmap
What does the future hold?
Provision of other layouts
Horizontal
137.
Limited entry
Automated optimisation
138.
Improved support for digitised condition states
139.
Integration of V&V providing visual feedback
Pluggable editors for Model Fact Types
140.
Usability enhancements
141.
Agenda
Overview
142.
Types
143.
Validation & Verification
144.
Transformation
145.
Decision Tables in Guvnor
146.
Roadmap
Summary
Q&A
147.
Summary Decision Tables
Are an important tool for modelling decisions
148.
Provide a simple, yet powerful, visualisation of decision components
149.
Allow large sets of related rules to be easily worked upon simultaneously
150.
Provide the means to easily validate and verify rules