Buenos Aires Decision Table presentation

2,316 views

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,316
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
102
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Buenos Aires Decision Table presentation

  1. 1. Michael Anstis Decision Tables & Guvnor
  2. 2. Agenda <ul><li>Introduction
  3. 3. Types
  4. 4. Validation & Verification
  5. 5. Transformation
  6. 6. What is Guvnor?
  7. 7. Decision Tables in Guvnor
  8. 8. Roadmap
  9. 9. Summary
  10. 10. Q&A </li></ul>
  11. 11. Agenda <ul><li>Introduction </li></ul><ul><li>Types
  12. 12. Validation & Verification
  13. 13. Transformation
  14. 14. What is Guvnor?
  15. 15. Decision Tables in Guvnor
  16. 16. Roadmap
  17. 17. Summary
  18. 18. Q&A </li></ul>
  19. 19. Agenda Some decisions are simple
  20. 20. Introduction - Some decisions are simple Should I fly to Buenos Aires?
  21. 21. Introduction - Some decisions are simple I want to treat myself
  22. 22. Introduction - Some decisions are simple
  23. 23. Agenda Some decisions are complex
  24. 24. Introduction - Some decisions are complex What insurance premium should I charge?
  25. 25. Introduction - Some decisions are complex <ul><li>Business considerations </li><ul><li>Applicant's age
  26. 26. Applicant's experience
  27. 27. Sailing qualifications
  28. 28. Value of vessel
  29. 29. Type of cover </li></ul></ul>
  30. 30. Introduction - Some decisions are complex <ul><li>Business considerations </li><ul><li>Applicant's age </li><ul><li>Only insure people over 25 years of age
  31. 31. If less than 35 add 10% surcharge
  32. 32. If less than 45 add 5% surcharge </li></ul></ul></ul>
  33. 33. Introduction - Some decisions are complex <ul><li>Business considerations </li><ul><li>Applicant's experience </li><ul><li>If sailing < 5 years then charge +10% </li></ul><li>Sailing qualifications </li><ul><li>None charge +100% </li></ul></ul><li>Etc... </li></ul>
  34. 34. Introduction - Enter the decision table <ul><li>Extract of decision table </li></ul>
  35. 35. Introduction - Overview <ul><li>Tabular representation of decisions.
  36. 36. 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>
  37. 37. Agenda <ul><li>Introduction </li></ul><ul><li>Types </li></ul><ul><li>Validation & Verification
  38. 38. Transformation
  39. 39. What is Guvnor?
  40. 40. Decision Tables in Guvnor
  41. 41. Roadmap
  42. 42. Summary
  43. 43. Q&A </li></ul>
  44. 44. Types <ul>Types </ul><ul><ul><li>Layout </li><ul><ul><ul><li>Sections
  45. 45. Horizontal
  46. 46. Vertical
  47. 47. Limited entry
  48. 48. Extended entry </li></ul></ul></ul><li>Categorisation </li><ul><ul><ul><li>Expanded form, contracted form
  49. 49. Multi-hit, all hits
  50. 50. Multi-hit, first hit
  51. 51. Single hit </li></ul></ul></ul></ul></ul>
  52. 52. Layouts <ul>Sections </ul>Conditions stub Actions stub Action states Condition states Rule identifiers
  53. 53. Layouts <ul>Sections </ul>
  54. 54. Layouts <ul>Horizontal </ul>
  55. 55. Layouts <ul>Vertical </ul>
  56. 56. Layouts <ul>Limited entry </ul>
  57. 57. Layouts <ul>Extended entry </ul>
  58. 58. Categorisation <ul>Expanded form </ul><ul><li>Single column for every condition combination
  59. 59. The number of columns should equal the product of the number of states for every condition. </li><ul><li>e.g. 2 conditions, one with 3 states the second with 2 states gives: </li></ul></ul>2 * 3 = 6 combinations
  60. 60. Categorisation <ul>Expanded form (continued) </ul><ul><li>Condition states should be discretized </li><ul><li>e.g. age: <18, 18-35, 36-60, >60 not a free-form integer field </li></ul><li>Discretization should cover entire domain range </li><ul><li>e.g. GOOD: age<18, age>=18; BAD: age<18, age>=30
  61. 61. 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>
  62. 62. Categorisation <ul>Expanded form (continued) </ul>
  63. 63. Categorisation <ul>Contracted form </ul><ul><li>Contraction is the first optimisation.
  64. 64. Reduces the number of condition columns.
  65. 65. 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>
  66. 66. Categorisation <ul>Contracted form – stage 1 Rules 2 and 3 are impossible conditions </ul>
  67. 67. Categorisation <ul>Contracted form – stage 2 Merge adjacent column groups with identical action parts </ul>
  68. 68. Categorisation <ul>Multi-hit, all hits </ul><ul><li>To get complete result all rules matching need to have their actions executed.
  69. 69. Condition columns are not mutually exclusive
  70. 70. 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>
  71. 71. 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
  72. 72. 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.
  73. 73. Condition columns are not mutually exclusive.
  74. 74. 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>
  75. 75. 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
  76. 76. Categorisation <ul>Single hit </ul><ul><li>Each possible combination of conditions matches exactly one, and only one, rule.
  77. 77. Condition columns are mutually exclusive
  78. 78. As the Condition columns are exclusive; combinations of conditions cannot be present in more than one column which eliminates ambiguity and inconsistency.
  79. 79. Classic form if Single-hit is &quot;expanded decision table&quot;; but this can be optimised or “contracted”. </li></ul>
  80. 80. 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
  81. 81. Agenda <ul><li>Introduction
  82. 82. Types </li></ul><ul><li>Validation & Verification </li></ul><ul><li>Transformation
  83. 83. What is Guvnor?
  84. 84. Decision Tables in Guvnor
  85. 85. Roadmap
  86. 86. Summary
  87. 87. Q&A </li></ul>
  88. 88. Validation & Verification <ul><li>Redundancy
  89. 89. Ambivalence (conflicting)
  90. 90. Deficiency
  91. 91. Mitigation </li></ul>
  92. 92. Validation & Verification <ul><li>Redundancy </li></ul><ul><li>Duplication
  93. 93. 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>
  94. 94. Validation & Verification <ul><li>Redundancy - Subsumption </li></ul>
  95. 95. 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>
  96. 96. Validation & Verification <ul><li>Ambivalence </li></ul><ul><ul><li>Premium is £500 if applicant age is less than 30
  97. 97. 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
  98. 98. 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>
  99. 99. 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
  100. 100. Missing knowledge </li><ul><li>The absence of some essential elements from the problem situation. </li></ul></ul>
  101. 101. 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>
  102. 102. 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
  103. 103. 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>
  104. 104. Validation & Verification <ul><li>Mitigation - deficiency </li></ul><ul><li>Missing rules </li></ul><ul><ul><li>Expanded decision table is exhaustive
  105. 105. 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
  106. 106. 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>
  107. 107. Agenda <ul><li>Introduction
  108. 108. Types
  109. 109. Validation & Verification </li></ul><ul><li>Transformation </li></ul><ul><li>What is Guvnor?
  110. 110. Decision Tables in Guvnor
  111. 111. Roadmap
  112. 112. Summary
  113. 113. Q&A </li></ul>
  114. 114. Transformation <ul><li>Decision Trees </li></ul><ul><li>Requirements </li></ul><ul><ul><ul><li>Discretized condition states
  115. 115. Each Condition in a column becomes a branch </li></ul></ul></ul><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>
  116. 116. Transformation <ul><li>Example - Decision Table </li></ul>
  117. 117. Transformation <ul><li>Example - Decision Tree </li></ul>
  118. 118. Transformation <ul><li>Paying attention?
  119. 119. Rules 1, 2 and 3, 4 have the same action no matter what the state of “Hungry”. Therefore they can be contracted... </li></ul>
  120. 120. Agenda <ul><li>Introduction
  121. 121. Types
  122. 122. Validation & Verification
  123. 123. Transformation </li></ul><ul><li>What is Guvnor? </li></ul><ul><li>Decision Tables in Guvnor
  124. 124. Roadmap
  125. 125. Summary
  126. 126. Q&A </li></ul>
  127. 127. What is Guvnor? <ul><li>Asset management system </li></ul>
  128. 128. What is Guvnor? <ul><li>Asset authoring environment </li></ul>
  129. 129. What is Guvnor? <ul><li>Asset quality assurance provider </li></ul>
  130. 130. What is Guvnor? <ul><li>Asset compilation service </li></ul>
  131. 131. Agenda <ul><li>Introduction
  132. 132. Types
  133. 133. Validation & Verification
  134. 134. Transformation
  135. 135. What is Guvnor? </li></ul><ul><li>Decision Tables in Guvnor </li></ul><ul><li>Roadmap
  136. 136. Summary
  137. 137. Q&A </li></ul>
  138. 138. Decision Tables in Guvnor <ul><li>What do we currently provide? </li></ul><ul><li>Vertical layout
  139. 139. Multi-hit, all hits
  140. 140. Extended entry
  141. 141. Discretized condition states (enumerated fields)
  142. 142. New decision table editor </li></ul><ul><ul><li>Foundation for future work
  143. 143. Condition and rule negation
  144. 144. Cell merging
  145. 145. Cell grouping </li></ul></ul>
  146. 146. Decision Tables in Guvnor <ul><li>What do we currently provide? </li></ul><ul>Cell merging </ul>
  147. 147. Decision Tables in Guvnor <ul><li>What do we currently provide? </li></ul><ul>Cell grouping </ul>
  148. 148. Decision Tables in Guvnor <ul><li>Generation of DRL
  149. 149. Each row compiles into a separate DRL rule </li></ul>
  150. 150. Decision Tables in Guvnor <ul><li>Generation of DRL
  151. 151. Each row compiles into a separate DRL rule
  152. 152. rule &quot;Row 1 dtable&quot;
  153. 153. dialect &quot;mvel&quot;
  154. 154. when
  155. 155. $person : Person( age < &quot;18&quot; )
  156. 156. then
  157. 157. $person.setHolidayEntitlement( 27 );
  158. 158. end
  159. 159. rule &quot;Row 2 dtable&quot;
  160. 160. dialect &quot;mvel&quot;
  161. 161. when
  162. 162. $person : Person( age >= &quot;18&quot; , age < &quot;45&quot; , lengthOfService < &quot;15&quot; )
  163. 163. then
  164. 164. $person.setHolidayEntitlement( 22 );
  165. 165. end </li></ul>
  166. 166. 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>
  167. 167. Agenda <ul><li>Introduction
  168. 168. Types
  169. 169. Validation & Verification
  170. 170. Transformation
  171. 171. What is Guvnor?
  172. 172. Decision Tables in Guvnor </li></ul><ul><li>Roadmap </li></ul><ul><li>Summary
  173. 173. Q&A </li></ul>
  174. 174. Roadmap <ul><li>What does the future hold? </li></ul><ul><li>Provision of other layouts </li><ul><li>Horizontal
  175. 175. Limited entry </li></ul></ul><ul><li>Automated optimisation
  176. 176. Improved support for digitised condition states
  177. 177. Integration of V&V providing visual feedback </li></ul><ul><li>Pluggable editors for Model Fact Types
  178. 178. Usability enhancements </li></ul>
  179. 179. Agenda <ul><li>Introduction
  180. 180. Types
  181. 181. Validation & Verification
  182. 182. Transformation
  183. 183. What is Guvnor?
  184. 184. Decision Tables in Guvnor
  185. 185. Roadmap </li></ul><ul><li>Summary </li></ul><ul><li>Q&A </li></ul>
  186. 186. Summary Decision Tables <ul><li>Are an important tool for modelling decisions
  187. 187. Provide a simple, yet powerful, visualisation of decision components
  188. 188. Allow large sets of related rules to be easily worked upon simultaneously
  189. 189. Provide the means to easily validate and verify rules </li></ul>Guvnor <ul><li>Existing capabilities suitable for most
  190. 190. A solid foundation for the future
  191. 191. A roadmap to become the market leader </li></ul>
  192. 192. Agenda <ul><li>Introduction
  193. 193. Types
  194. 194. Validation & Verification
  195. 195. Transformation
  196. 196. What is Guvnor?
  197. 197. Decision Tables in Guvnor
  198. 198. Roadmap
  199. 199. Summary </li></ul><ul><li>Q&A </li></ul>
  200. 200. 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>
  201. 201. Michael Anstis Decision Tables & Guvnor

×