Drools Presentation for Tallink.ee


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Drools Presentation for Tallink.ee

  1. 1. Anton Arhipov [email_address] http://arhipov.blogspot.com
  2. 2. INTRODUCTION Rule Engine BRMS
  3. 3. Rule Engine A business rules engine is a software system that executes one or more business rules in a runtime production environment. - Wikipedia
  4. 4. Advantages <ul><li>Declarative programming </li></ul><ul><ul><li>Rule engines allow you to say &quot;What to do&quot; not &quot;How to do it&quot;. </li></ul></ul><ul><li>Logic and data separation </li></ul><ul><ul><li>Your data is in your domain objects, the logic is in the rules. </li></ul></ul><ul><li>Centralization of knowledge </li></ul><ul><ul><li>By using rules, you create a repository of knowledge which is executable. </li></ul></ul><ul><li>Explanation facility </li></ul><ul><ul><li>Rule systems effectively provide an &quot;explanation facility&quot; by being able to log the decisions made by the rule engine along with why the decisions were made. </li></ul></ul><ul><li>Understandable rules </li></ul><ul><ul><li>By creating object models and, optionally, Domain Specific Languages that model your problem domain you can set yourself up to write rules that are very close to natural language. </li></ul></ul>
  5. 5. When to use Rule Engine? <ul><li>The general answer is: &quot;when there is no satisfactory traditional programming approach to solve the problem&quot; </li></ul><ul><li>The problem is just too fiddle for traditional code. </li></ul><ul><li>The problem is beyond any obvious algorithm based solution. </li></ul><ul><li>The logic changes often </li></ul><ul><li>Domain experts are readily available, but are nontechnical. </li></ul>If rules are a new technology for your project teams, the overhead in getting going must be factored in.
  6. 6. When NOT to use Rule Engine? <ul><li>… in the excitement of working with rules engines, that people forget that a rules engine is only one piece of a complex application or solution. </li></ul>If you just need to bypass the release process , think twice before using the rule engine. It works best if you can write the rules in declarative manner
  7. 7. BRMS <ul><li>A BRMS or Business Rule Management System is a software system used to manage the variety and complexity of decision logic (a.k.a business rules ) that is used by operational systems within an organization or enterprise. - Wikipedia </li></ul><ul><li>Features: </li></ul><ul><ul><li>A repository, allowing decision logic to be externalized from core application code </li></ul></ul><ul><ul><li>Tools, allowing both technical developers and business experts to define and manage decision logic </li></ul></ul><ul><ul><li>A runtime environment, allowing applications to invoke decision logic managed within the BRMS and execute it using a business rule engine </li></ul></ul>
  8. 8. Why do you need BRMS at all? <ul><li>Flexibility </li></ul><ul><ul><li>Alter the system behavior in production </li></ul></ul><ul><li>Separation of concern </li></ul><ul><ul><li>A good practice in software engineering, everything is separated. Keep rules out of the application. </li></ul></ul><ul><li>Centralized rules repository </li></ul><ul><ul><li>The dream of every IT organization . </li></ul></ul><ul><li>Business teams closer to implementation </li></ul><ul><ul><li>The business analyst can view and play with rules that effect business and hence get very close to the implementation. </li></ul></ul>
  9. 9. Emmmm……
  10. 11. http://www.jboss.org/drools
  11. 12. http://blog.athico.com
  12. 13. irc.codehaus.org #drools
  13. 14. InfoWorld BOSSIE Awards 2008
  14. 17. Authoring <ul><li>I nvolves the creation of DRL or XML files for rules which are fed into a parse r. </li></ul><ul><li>Package b uilder also undertakes any code generation and compilation </li></ul><ul><li>A p ackage is self contained and deployable, in that it's a serialized object consisting of one or more rules . </li></ul>
  15. 18. The Rule
  16. 19. Runtime <ul><li>A RuleBase is a runtime component which consists of one or more p ackages . </li></ul><ul><li>A RuleBase can instantiate one or more WorkingMemories . </li></ul>
  17. 20. The API
  18. 21. Deployment
  19. 22. DEMO
  20. 23. Questions yet?
  21. 25. Drools Flow <ul><li>A workflow engine combining processes and rules </li></ul><ul><li>A workflow is a process that describes the order in which series of steps need to be executed, using a flow chart. </li></ul>
  22. 26. Evaluating a set of rules in your process <ul><li>The rules that need to be evaluated should be grouped in a ruleflow group (using the ruleflow-group rule attribute) and a RuleSet node can be used to trigger the evaluation of these rules in your process. </li></ul>
  23. 27. Rules + Processes <ul><li>A workflow engine combining processes and tools </li></ul><ul><li>Why rules in processes? </li></ul><ul><ul><li>Simplicity : Complex decisions are usually easier to specify using a set of rules. </li></ul></ul><ul><ul><li>Agility : Rules and processes can have a separate life cycle. </li></ul></ul><ul><ul><li>Different scope : Rules can be reused accross processes or outside processes. </li></ul></ul><ul><ul><li>Declarative : Focus on describing 'what' instead of 'how'. </li></ul></ul><ul><ul><li>Granularity : It is easy to write simple rules that handle specific circumstances. Processes more suited to describe the overall control flow . </li></ul></ul><ul><ul><li>Performance : No unnecessary passing, transformation or synchronization of data . </li></ul></ul>
  24. 28. The API
  25. 29. DEMO
  26. 30. Question yet again??
  27. 32. Guided Editing
  28. 33. Guided Editing
  29. 34. Guided Editing
  30. 35. Decision Tables
  31. 36. QA
  32. 37. QA
  33. 38. What’s next?