Geoffrey De Smet Why do I need the Guvnor BRMS?
Guvnor agenda <ul><li>Use cases
My business requires domain expertise
My business rules change often
Auditable and reproducible
Future improvements </li></ul>
Use cases I have hammer, so every problem is a nail?
The myth <ul><li>Because </li><ul><li>Drools can fulfil business rules
Drools is  Turing complete </li></ul><li>we should write the entire business layer in Drools? </li><ul><li>No!
Not imperative like Java, Scala, Groovy, ...
Declarative like RegEx, SQL, JPA-QL, … </li><ul><li>Easier to read, better at scaling </li></ul></ul><li>Extract business ...
Change often/fast </li></ul></ul>
Use cases <ul><li>Financial decisions </li><ul><li>Mortgages acceptance and interest calculation
Insurances acceptance and fee calculation </li></ul><li>Price calculations </li><ul><li>Phone/Telecom bills </li></ul><li>...
Mortgages example
Developers don't like data input from spreadsheets <ul><li>Before App 1.0: Mortgages rules in a spreadsheet </li><ul><li>W...
Which field has the result our application need? </li></ul></ul>Version 1 Version 2
Mortgage experts like the flexibility of spreadsheets <ul><li>Since App 1.0: Mortgages rules in source code </li><ul><li>C...
when income below 1000 and age above 50
when income below 1% of mortgage amount </li></ul></ul>
Data model in Guvnor <ul><li>Import POJO jar
or  Design the model in Guvnor: </li></ul>
Mortgage  experts like the flexibility of Guvnor <ul><li>App 2.0: Mortgage rules in Guvnor repository </li><ul><li>Flexibl...
My business requires domain expertise Only mortgage managers understand mortgage rules
Schooled domain expertise <ul><li>Are we, the developers, domain experts? </li><ul><li>Yes, we've been working in this com...
participated in mortgages conferences/courses? No
years of mortgage customer experience? No </li></ul><li>Do we have a clue when the mortgage rules need to change? No
Are we, the developers, domain experts?  No </li><ul><li>Mortgage manager is the domain expert </li></ul></ul>
Domain experts can not read/write Java source code <ul><li>Communication problem </li><ul><li>Domain expert can not read i...
Domain experts can read/write DRL with Guided Rule Editor Change
Upcoming SlideShare
Loading in...5
×

2011-03-29 London - Why do I need the guvnor BRMS?

7,995

Published on

Why do I need the Guvnor BRMS and the Drools rule engine?

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

No Downloads
Views
Total Views
7,995
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
230
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "2011-03-29 London - Why do I need the guvnor BRMS?"

  1. 1. Geoffrey De Smet Why do I need the Guvnor BRMS?
  2. 2. Guvnor agenda <ul><li>Use cases
  3. 3. My business requires domain expertise
  4. 4. My business rules change often
  5. 5. Auditable and reproducible
  6. 6. Future improvements </li></ul>
  7. 7. Use cases I have hammer, so every problem is a nail?
  8. 8. The myth <ul><li>Because </li><ul><li>Drools can fulfil business rules
  9. 9. Drools is Turing complete </li></ul><li>we should write the entire business layer in Drools? </li><ul><li>No!
  10. 10. Not imperative like Java, Scala, Groovy, ...
  11. 11. Declarative like RegEx, SQL, JPA-QL, … </li><ul><li>Easier to read, better at scaling </li></ul></ul><li>Extract business decisions in Drools that either: </li><ul><li>Require schooled domain expertise
  12. 12. Change often/fast </li></ul></ul>
  13. 13. Use cases <ul><li>Financial decisions </li><ul><li>Mortgages acceptance and interest calculation
  14. 14. Insurances acceptance and fee calculation </li></ul><li>Price calculations </li><ul><li>Phone/Telecom bills </li></ul><li>Diagnostics </li><ul><li>Possible diseases based on symptoms </li></ul><li>Complex validation </li><ul><li>Car parts selection </li></ul><li>Not a good use case: an XML parser </li><ul><li>Use Java code for that </li></ul></ul>
  15. 15. Mortgages example
  16. 16. Developers don't like data input from spreadsheets <ul><li>Before App 1.0: Mortgages rules in a spreadsheet </li><ul><li>Which version/copy of the spreadsheet file?
  17. 17. Which field has the result our application need? </li></ul></ul>Version 1 Version 2
  18. 18. Mortgage experts like the flexibility of spreadsheets <ul><li>Since App 1.0: Mortgages rules in source code </li><ul><li>Changing business rules not flexible enough </li><ul><li>Business rules are hard coded in Java </li></ul></ul></ul>Invalid: must be a number <ul><li>Flooded with new improvement requests: </li><ul><li>when income below 500
  19. 19. when income below 1000 and age above 50
  20. 20. when income below 1% of mortgage amount </li></ul></ul>
  21. 21. Data model in Guvnor <ul><li>Import POJO jar
  22. 22. or Design the model in Guvnor: </li></ul>
  23. 23. Mortgage experts like the flexibility of Guvnor <ul><li>App 2.0: Mortgage rules in Guvnor repository </li><ul><li>Flexible like spreadsheet </li><ul><li>But fields clearly defined </li></ul><li>No spreadsheet versions/copies </li><ul><li>Auditable </li></ul></ul></ul>
  24. 24. My business requires domain expertise Only mortgage managers understand mortgage rules
  25. 25. Schooled domain expertise <ul><li>Are we, the developers, domain experts? </li><ul><li>Yes, we've been working in this company for year(s). </li></ul><li>Do we have </li><ul><li>university's degree in economics? No
  26. 26. participated in mortgages conferences/courses? No
  27. 27. years of mortgage customer experience? No </li></ul><li>Do we have a clue when the mortgage rules need to change? No
  28. 28. Are we, the developers, domain experts? No </li><ul><li>Mortgage manager is the domain expert </li></ul></ul>
  29. 29. Domain experts can not read/write Java source code <ul><li>Communication problem </li><ul><li>Domain expert can not read it: </li></ul></ul>for (Mortgage m : mortgages ) { for (Applicant a : m.getApplicants()) { if (a.getAge() > 70 ) { boolean existsGuarantor = false ; for (Guarantor g : m.getGuarantors() { if (g.getAge < 60 ) { existsGuarantor = true ; } } // Will they spot the bug in this code? if (existsGuarantor) { m.setApproved( false ); } } } } <ul><li>DRL scales better than this Java code </li></ul>
  30. 30. Domain experts can read/write DRL with Guided Rule Editor Change
  31. 31. Guided Rule Editor demo video Demo video
  32. 32. Domain experts can read/write DSL even better <ul><li>DSL is even easier to read/write </li></ul><ul><li>Developers create the building blocks
  33. 33. Domain experts make the building </li></ul>Source: wikipedia
  34. 34. My business rules change often This mortgage rule change must be released by noon
  35. 35. Deliver changes fast
  36. 36. Business rule change <ul><li>Not a data change </li><ul><li>Requires test and release lifecycle
  37. 37. Logic changes </li></ul><li>Not a software change </li><ul><li>Delivered in hours, not days
  38. 38. Self-service by mortgage manager </li></ul></ul>
  39. 39. Testing before releasing <ul><li>Domain experts need to unit test too </li><ul><li>Example: mortgage of Erik (75) must be disapproved </li></ul></ul>
  40. 40. Releasing <ul><li>Release a snapshot of the rules package
  41. 41. Available at URL: </li><ul><li>http://127.0.0.1:8888/org.drools.guvnor.Guvnor/package/presentationmortgages/mortgagesDeployment </li></ul></ul>
  42. 42. Deployment infrastructure
  43. 43. Auditable and reproducible Why was that mortgage approved last year?
  44. 44. Auditing <ul><li>View old revisions of rules </li></ul>
  45. 45. Future improvements Feed-back welcome
  46. 46. Modules: reuse rules <ul><li>Module contains assets (rules) </li><ul><li>Packages will be renamed to modules </li></ul><li>Module can depend on other modules </li><ul><li>Reuse of assets (rules) from other modules
  47. 47. Dependency graph (like Maven/OSGi but simplified) </li></ul></ul>Mortgage rules Car loan rules General loan rules Customer rules 2.0 1.1 1.1 2.1
  48. 48. Extended release lifecycle <ul><li>Draft
  49. 49. Test
  50. 50. Released </li><ul><li>Version
  51. 51. Immutable (all dependent modules are released) </li></ul></ul>
  52. 52. Summary
  53. 53. Summary <ul><li>Use Drools and Guvnor
  54. 54. when your business decisions either </li><ul><li>Require domain expertise
  55. 55. Change often/fast </li></ul></ul>
  56. 56. Q & A <ul><li>Questions?
  57. 57. Useful links
  58. 58. Website
  59. 59. http://www.jboss.org/drools/
  60. 60. Reference manual
  61. 61. http://www.jboss.org/drools/documentation.html
  62. 62. Blog
  63. 63. http://blog.athico.com/
  64. 64. Mailing lists (forum interface through nabble.com)
  65. 65. http://www.jboss.org/drools/lists.html </li><ul><li>Slides available online </li></ul></ul>
  1. A particular slide catching your eye?

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

×