Michael Anstis Decision Tables in depth
Agenda <ul><li>Overview
Types
Validation & Verification
Transformation
Decision Tables in Guvnor
Roadmap
Summary
Q&A </li></ul>
Agenda <ul><li>Overview </li></ul><ul><li>Types
Validation & Verification
Transformation
Decision Tables in Guvnor
Roadmap
Summary
Q&A </li></ul>
Overview <ul><li>Tabular representation of decisions.
Compact way to model large sets of related rules. </li></ul><ul><li>The state of a number of conditions determines the exe...
Agenda <ul><li>Overview </li></ul><ul><li>Types </li></ul><ul><li>Validation & Verification
Transformation
Decision Tables in Guvnor
Roadmap
Summary
Q&A </li></ul>
Types <ul>Types </ul><ul><ul><li>Layout </li><ul><ul><ul><li>Horizontal
Vertical
Limited entry
Extended entry </li></ul></ul></ul><li>Categorisation </li><ul><ul><ul><li>Expanded form, contracted form
Multi-hit, all hits
Multi-hit, first hit
Single hit </li></ul></ul></ul></ul></ul>
Layouts <ul>Horizontal </ul>
Layouts <ul>Vertical </ul>
Layouts <ul>Limited entry </ul>
Layouts <ul>Extended entry </ul>
Categorisation <ul>Expanded form </ul><ul><li>Single column for every condition combination
The number of columns should equal the product of the number of states for every condition. </li><ul><li>e.g. 3 conditions...
Categorisation <ul>Expanded form  (continued) </ul><ul><li>Condition states should be digitised  </li><ul><li>e.g. age: <1...
Not essential for expansion but ensures completeness </li></ul><li>This guarantee of completeness of condition combination...
Categorisation <ul>Expanded form  (continued) </ul>
Categorisation <ul>Contracted form </ul><ul><li>Contraction is the first optimisation.
Reduces the number of condition columns.
If the same actions exist for rules covering all condition states for a given condition they can be combined and the condi...
Categorisation <ul>Contracted form – stage 1 Rules 2 and 3 are impossible conditions </ul>
Categorisation <ul>Contracted form – stage 2 Merge adjacent column groups with identical action parts </ul>
Categorisation <ul>Multi-hit, all hits </ul><ul><li>To get complete result all rules matching need to have their actions e...
Condition columns are not mutually exclusive
If the Condition columns are not exclusive, some combination of conditions are present in more than one column, which may ...
Categorisation <ul>Multi-hit, all hits </ul>Given a 35 year old with 15 years service 1. Rule 1 matches, giving 22 days 2....
Categorisation <ul>Multi-hit, first hit </ul><ul><li>To get complete result the first rule (from left-to-right) matching n...
Condition columns are not mutually exclusive.
Upcoming SlideShare
Loading in...5
×

2011-03-29 London - Decision tables in depth (Michael Anstis)

5,267
-1

Published on

Decision tables in depth

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,267
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
219
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

2011-03-29 London - Decision tables in depth (Michael Anstis)

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

    Clipping is a handy way to collect important slides you want to go back to later.

×