Drools
Upcoming SlideShare
Loading in...5
×
 

Drools

on

  • 14,711 views

Overview of business rules engine with specific details on JBoss's Drools.

Overview of business rules engine with specific details on JBoss's Drools.

Statistics

Views

Total Views
14,711
Views on SlideShare
14,647
Embed Views
64

Actions

Likes
13
Downloads
568
Comments
0

5 Embeds 64

http://www.slideshare.net 59
http://nrg.wikispaces.com 2
http://nrg-ops.wikispaces.com 1
http://www.techgig.com 1
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Drools Drools Presentation Transcript

  • An Introduction to Business Rules with JBoss Drools John Paulett October 12, 2009
  • Goals Introduction to “business rules” High level overview of JBoss Drools Discussion of benefits and shortcomings 10/12/2009 2
  • Business Rules 10/12/2009 3
  • Problem Domain Basic problem: how to model “business logic” In this context: “business logic” ≠ code between UI and DB “business logic” = policies of the business 10/12/2009 4
  • Business Logic Examples Rate calculations at insurance company ● Depends on laws, age, sex, location, previous history, desired coverage, etc. Critical lab values at hospital ● Depends on age, previous values, other lab tests, diagnose, mandates, etc. 10/12/2009 5
  • Business Rule Engine Type of Expert System Two types of rules: ● “Production (or Inference) Rules” – If x, then y – Often stateless ● “Reaction Rules” (Complex Event Processing) – Wait for set of events – Stateful 10/12/2009 6
  • Forward Chaining 1) Iterate through antecedents (if …) 2) Each time an antecedent is matched, add knowledge of consequent (then …) 3) Go to #1, until goal reached 10/12/2009 7
  • Rete Algorithm Naïve forward chaining does not scale well as number of rules increases Efficient implementation using directed acyclic graph representation of rules Higher memory consumption for increased speed 10/12/2009 8
  • JBoss Drools 10/12/2009 9
  • JBoss Drools Suite Guvnor – Business Rule Management System Expert – Production Rules Flow – Workflow Fusion – Complex Event Processing 10/12/2009 10
  • Drools Expert Core Drools product Forward chaining rules with Rete Eclipse authoring plugin 10/12/2009 11
  • Ways to Write Rules Technical Rule Language Custom Domain Specific Languages Guided Editor Decision Table 10/12/2009 12
  • Technical Rule Language rule "Hello World" when m : Message( status == Message.HELLO, myMessage : message ) then System.out.println( myMessage ); m.setMessage( "Goodbye cruel world" ); m.setStatus( Message.GOODBYE ); update( m ); end 10/12/2009 13
  • Custom DSLs Map “natural language” into Technical Rule Language 10/12/2009 14
  • Guided Editor From http://www.jboss.org/drools/drools-expert.html 10/12/2009 15
  • Decision Table Excel XLS based 10/12/2009 16
  • Drools Guvnor BRMS – Business Rule Management System Centralized knowledgebase Web-based rule authoring Versioning of rules 10/12/2009 17
  • Drools Guvnor Manage rules through web console From http://www.jboss.org/drools/drools-guvnor.html 10/12/2009 18
  • Drools Guvnor Edit rules through web console From http://www.jboss.org/drools/drools-guvnor.html 10/12/2009 19
  • Drools Flow Workflow management From http://www.jboss.org/drools/drools-guvnor.html 10/12/2009 20
  • Drools Fusion Extension to Drools Expert for temporal reasoning Detects relevant patterns in “cloud or stream of events” 10/12/2009 21
  • Discussion 10/12/2009 22
  • When To Use a Rules Engine Large set of rules, with complex branching Rules likely to change over time, likely out of sync with code changes Involve “business users” in creation & maintenance of rules 10/12/2009 23
  • Benefits Separates “business logic” from application code “Hot” changes of rules (no recompile) Improved performance for large rule sets Communicates rules more clearly than Java code 10/12/2009 24
  • Downsides New tool ● Learning curve ● Extra point of failure Overhead ● Not practical for small rule sets 10/12/2009 25
  • Alternatives Java Rule Engine API - JSR 94 Closed Source: ● IBM's ILOG JRules, Fair Isaac's Blaze Advisor Open Source: ● Jess, OpenRules, Zilonis, take 10/12/2009 26
  • References http://www.jboss.org/drools/ http://java.sun.com/developer/technicalArticles/J2SE/JavaRule.html http://java.sys-con.com/node/45082 http://herzberg.ca.sandia.gov/guidelines.shtml 10/12/2009 27