SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Programming With Rules

     Srinath Perera, Ph.D.
     Architect, WSO2 Inc.
Rule based Systems

    ●   Expert Systems / Business
        rules engine / Production
        Systems / Inference Engines
        are used to address rule
        engines based on their
        implementations and use.
    ●   Something most people like to
        have, although not many
        people know why they need it.
Rules
●   Allow users to specify the requirements/
    knowledge about processing using
    – Declarative (Say what should happen, not how to
        do it)
    –   Logic based languages.
Types of Rules
●   Four types of rules (from
    http://www.w3.org/2000/10/swap/doc/rule-systems)
    –   Derivation or Deduction Rules – Each rules express if
        some statements are true, another statement must be
        true. Called logical implication. E.g. Prolog
         –   Transformation Rules- transform between knowledge
               bases, e.g. theorem proving
    –   Integrity Constraints – verification rules
    –   Reaction or Event-Condition-Action (ECA) Rules –
        includes a actions in addition to inference. e.g. Drools
Two types of Rule Engines
●   Forward Chaining – starts with facts/data and
    trigger actions or output conclusions
●   Backward chaining – starts with goals and
    search how to satisfy that (e.g. Prolog)
Production Systems
●   Drools belongs to the category of rule engines called
    production systems [1] (which execute actions based
    on conditions)
●   Drools use forward chaining[2] (start with data and
    execute actions to infer more data )
●   Priorities assigned to rules are used to decide the
    order of rule execution
●   They remember all results and use that to optimize
    new derivations (dynamic programming like)

       http://en.wikipedia.org/wiki/AI_production
       http://en.wikipedia.org/wiki/Forward_chaining
Big Picture
●   Usually a Rule engine
    usually includes three
    parts.
    –   Facts represented as
        working memory
    –   Set of rules that
        declaratively define
        conditions or situations
        e.g. Prolog route(X,Z) <-
        road(X,Z)
    –   Actions executed or
        inference derived based
        on the rules
Why rule engines?
●   Simplify complicated requirements with
    declarative logic, raising the level of abstraction
    of the system
●   Externalize the business logic (which are too
    dynamic) from comparatively static code base
●   Intuitive and readable than code, easily
    understood by business people/ non technical
    users

                          http://en.wikipedia.org/wiki/AI_production
                          http://en.wikipedia.org/wiki/Forward_chaining
Why rule engines? [Contd.]
●   Create complex interactions which can have
    powerful results, even from simple facts and rules.
●   Different approach to the problem, some problem
    are much easier using rules.
●   Can solve hard problems (Problems we only
    understand partially)
●   Fast and scalable when there is a data set that
    changes little by little
When to use Rules?
●   When there is no satisfactory traditional
    programming approach to solve the problem!
●   To separate code and business logic
●   The problem is beyond any obvious algorithmic
    solution. (not fully understood)
●   When the logic changes often
●   When Domain experts are none technical.
1. Real-World Rule Engines
   http://www.infoq.com/articles/Rule-Engines
2. Why are business rules better than traditional code?
   http://www.edmblog.com/weblog/2005/11/why_are_busines.html
3. Rules-based Programming with JBoss Rules/Drools
    www.codeodor.com
When not to use rule engines?
●   It is slower then usual code most of the time, so
    unless one of the following is true is should not
    be used
     – Complexity of logic is hard to tackle
     – Logic changes too often
     – Required to use by non technical users
     – It is a usecase where rules are faster.
●   Interactions between rules could be quite
    complex, and one mistake could change the
    results drastically and unexpected way e.g.
    recursive rules
●   Due to above testing and debugging is required,
    so if results are hard to verified it should not be
    used.
Drools Rule Engine
●   Forward chaining, production system based on
    Rete algorithm.
●   Written in Java, and support OOP based
    model
●   Open source/ Apache License compatible
●   Backed up JBoss, also called JBoss rules
●   Link http://jboss.org/drools
Model




●   Facts as a Object repository of java objects
●   New objects can be added, removed or updated
●   support if <query> then <action> type rules
●   Queries use OOP format
Drools Rule Language
Anatomy of a Rule
●   Has two parts
    rule "rule-name"
    when
         <query in a Object query
           language>
    then
         <any java code>
    end
●   When condition is satisfied, action is carried
     out.
Business Rules
●   Working Memory
    –   Insert, retract, update
●   Stateful sessions
●   Stateless sessions
●   Queries -
        QueryResults results = ksession.getQueryResults(
          "my query", new Object[] { "string" } );

●   Globals ksession.setGlobal("list", list);
●   Agenda filters makes sure only selected rules are
    fired. ksession.fireAllRules( new
    RuleNameEndsWithAgendaFilter( "Test" ) );
Rete Algorithm




●   Dr Charles L. Forgy's Ph.D. Thesis, 1974
●   Creates a tree representing rules, and data
    propagate through the tree and out put actions.
●   Partial results are saved in memory.
A Sample Rule
Following rule increase the premium by 15% if driver is
less than 25 and drives a sport car.
rule "MinimumAge"
when
      $d : Customer(age < 25)
       $c : Car(vin=$d.vin && model =
“sport”)
then
      c.IncreasePrimium(15);
end
Actions
●   Any java code goes in the then clause
●   Also support some level of scripts
●   Operations on working memory
    –   update(object); will tell the engine that an object has
        changed
    –   insert(new Something()); will place a new object of
        your creation into the Working Memory.
    –   insertLogical(new Something()); is similar to insert,
        but the object will be automatically retracted when
        there are no more facts to support the truth of the
        currently firing rule.
    –   retract(handle); removes an object from Working
        Memory.
Rule Patterns
Following rule reject all customers whose age less than 17.
rule "MinimumAge"
when
     c : Customer(age < 17)
then
     c.reject();
end
Conditions support <, >, ==, <=, >=, matches / not matches,
contains / not contains. And following rules provide a discount
if customer is married or older than 25.

rule "Discount"
when
    c : Customer( married == true || age > 25)
then
    c.addDiscount(10);
end
Joins
Following rule increase the premium by 15% if driver is
less than 25 and drives a sport car.
rule "MinimumAge"
when
      $d : Customer(age < 25)
       $c : Car(vin=$d.vin && model =
“sport”)
then
      c.IncreasePrimium(15);
end
Bound variables
Bound variables
 when
          Person( likes : favouriteCheese )
          Cheese( type == likes )
 then
        …
 end
OR, AND
●   OR – true if either of the statements true
     –   E.g. Customer(age > 50) or Vehicle( year > 2000)
●   AND – provide logical, if no connectivity is define
    between two statements, “and” is assumed by default.
    For an example.
      c : Customer( timeSinceJoin > 2);
      not (Accident(customerid == c.name))
    and
    c : Customer( timeSinceJoin > 2) and
            not (Accident(customerid == c.name))
    are the same.
eval(..)
●   eval(boolean expressions) – with eval(..) any
    Boolean expression can be used.
     – E.g. C:Customer(age > 20)
             eval(C.calacuatePremium() > 1000)
●   Can not hold partial results for eval(..) so
    Drools going to recalculate eval(..)
    statements and what ever trigged from that.
●   So it is going to be inefficient, so use
    sparingly
Not
●   Not – negation or none can be found. E.g.
        not Plan( type = “home”)

    is true if no plan of type home is found. Following
    is true if customer has take part in no accidents.
    rule "NoAccident"
    when
         c : Customer( timeSinceJoin > 2);
         not (Accident(customerid == c.name))
    then
         c.addDiscount(10);
    end
For all
●   True if all objects selected by first part of the
    query satisfies rest of the conditions. For an
    example following rule give 25 discount to
    customers who has brought every type of plans
    offered.
    rule "OtherPlans"
    when
         forall ($plan : PlanCategory() c : Customer(plans
    contains $plan))
    then
         c.addDiscount(25);
    end
Exists
●   True if at least one matches the query,
●   This is Different for just having Customer(), which is
    like for each which get invoked for each matching set.
●   Following rule give a discount for each family where
    two members having plans


        rule “FamilyMembers"
        when
           $c : Customer()
           exists (Customer( name contains $c.family))
        then
           c.addDiscount(5);
        end
From
●   True if at least one matches the query,
●   This is Different for just having Customer(), which is
    like for each which get invoked for each matching
    set.
●   Following rule give a discount for each family where
    two members having plans
    rule "validate zipcode"
    when
       Person( $personAddress : address )
       Address( zipcode == "23920W") from $personAddress
    then
       # zip code is ok
    end
Collect
●   True if at least one matches the query,
●   This is Different for just having Customer(), which is
    like for each which get invoked for each matching set.
●   Following rule give a discount for each family where
    two members having plans

rule "Raise priority if system has more than 3 pending alarms"
when
   $system : System()
   $alarms : ArrayList( size >= 3 )
          from collect( Alarm( system == $system, status == 'pending' ) )
then
   # Raise priority, because system $system has
   # 3 or more alarms pending. The pending alarms
   # are $alarms.
end
Accumulate
●   True if at least one matches the query,
●   This is Different for just having Customer(), which is like
    for each which get invoked for each matching set.
●   Following rule give a discount for each family where two
    members having plans

    rule "Apply 10% discount to orders over US$ 100,00"
    when
       $order : Order()
       $total : Number( doubleValue > 100 )
             from accumulate( OrderItem( order == $order, $value : value ),
                        init( double total = 0; ),
                        action( total += $value; ),
                        reverse( total -= $value; ),
                        result( total ) )
    then
       # apply discount to $order
    end
Conflict resolution
•    Each rule may define attributes There are other parameters
     you can found from [1]. E.g.
     rule "MinimumAge"
     salience = 10
     when
           c : Customer(age < 17)
     then
           c.reject();
     end



•    salience define priority of the rule and decide their activation
     order.
1.   http://labs.jboss.com/drools/documentation.html
WSO2 Deployment as an
              Example
●   There are our product Instances (e.g. WSAS, Greg,
    IS, ESB) etc, which has been mapped to a facts in
    the rule system, and it is updated using a system
    management solution.
●   They have a role property, that says what is there
    role. e.g. ESB role=”lb” means it is a load balancer.
●   Each host is represented by Host() object, and each
    server have a property called host.
●   Each server has a state, which is Up, Down
Question 1:
●   A system is considered healthy if there is One ESB,
    two WSAS instances, one load balance instance, one
    BPS server, and one Identity server.
●   Write a rule to detect if system is healthy and print it.
       When
          ESB(role !=”lb”);
          List(size ==2) from collect (WSAS());
          ESB(role==”lb”);
          BPS();
          IS();
       then
              System.out.println(“System Healthy”);
       end
Question 2:
●   If any server has failed but the host is up, restart the
    server using a rule. Assume there is
    system.restart(service-name, host).

       When
          wsas:WSAS(state=”Down”);
          host:Host(state=”Up” && wsas.host=name);
       then
             system.restart(wsas);
       end
Question 3:
●   If a host has failed, start the servers in the host using
    a rule. Assume there is system.start(service-name,
    host).

       When
          wsas:WSAS();
          host:Host(state=”Down” && wsas.host=name);
       then
          system.start(wsas);
       end
Question 4:
●   Assume there are cluster of 10 WSAS nodes, if the
    average TPS is > 300, add a new node to the cluster.
    Assume WASA expose TPS via a property called tps.

      rule "Apply 10% discount to orders over US$ 100,00"
      when
         $order : Order()
         $total : Number( doubleValue > 300)
               from accumulate( WSAS( $tps : tps),
                           init( double tpstot = 0; int count = 0; ),
                          action( tpstot += $tps; count++ ),
                          reverse( tpstot -= $tps; count-- ),
                          result( tpstot/count ) )
      then
         # apply discount to $order
      end
Drools Performance
•    Measuring Rule engine performance is tricky.
•    Main factors are number of objects and number of rules. But results
     depends on nature of rules.
•    A user feedback [1] claims Drools about 4 times faster than JRules [4].


                                          (SequentialRete)

     rules             Objects           Drools               JRules

     1219              100               4ms/4ms              16ms/15ms


•    [2] shows a comparison between Drools, Jess [5] and Microsoft rule
     engine. Overall they are comparable in performance.
1.   http://blog.athico.com/2007/08/drools-vs-jrules-performance-and-future.html
2.   http://geekswithblogs.net/cyoung/articles/54022.aspx
1.   Jess - http://herzberg.ca.sandia.gov/jess/
2.   JRules http://www.ilog.com/products/jrules/
Drools Performance Contd.
I have ran the well known rule engine bench mark [1] implementation provided with Drools. (On linbox3 - 1GB memory, 4 CPU
•
3.20GHz )




       Bench Marks                 Rule Count                  Object                      Time (ms)
                                                               Count
       Waltz                       31                          958                         1582
                                   31                          3873                        9030
       Waltz DB                    34                          393                         420


                                   34                          697                         956
                                   34                          1001                        1661
                                   34                          1305                        2642




http://www.cs.utexas.edu/ftp/pub/ops5-benchmark-suite/HOW.TO.USE
1.
Questions?

Contenu connexe

Tendances

Drools 6 deep dive
Drools 6 deep diveDrools 6 deep dive
Drools 6 deep diveMario Fusco
 
Créer des applications Java avec MongoDB
Créer des applications Java avec MongoDBCréer des applications Java avec MongoDB
Créer des applications Java avec MongoDBMongoDB
 
Introduction aux bases de données NoSQL
Introduction aux bases de données NoSQLIntroduction aux bases de données NoSQL
Introduction aux bases de données NoSQLAntoine Augusti
 
Initiation à Android
Initiation à AndroidInitiation à Android
Initiation à AndroidLilia Sfaxi
 
Alphorm.com Formation Docker (1/2) : Installation et Administration
Alphorm.com Formation Docker (1/2) : Installation et AdministrationAlphorm.com Formation Docker (1/2) : Installation et Administration
Alphorm.com Formation Docker (1/2) : Installation et AdministrationAlphorm
 
Decision Model and Notation (DMN) and Drools DMN support
Decision Model and Notation (DMN) and Drools DMN supportDecision Model and Notation (DMN) and Drools DMN support
Decision Model and Notation (DMN) and Drools DMN supportMatteo Mortari
 
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0Pierre Feillet
 
Cours Big Data Chap4 - Spark
Cours Big Data Chap4 - SparkCours Big Data Chap4 - Spark
Cours Big Data Chap4 - SparkAmal Abid
 
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model ServingKubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model ServingTheofilos Papapanagiotou
 
Rule Engine: Drools .Net
Rule Engine: Drools .NetRule Engine: Drools .Net
Rule Engine: Drools .NetGuo Albert
 
Apache zookeeper 101
Apache zookeeper 101Apache zookeeper 101
Apache zookeeper 101Quach Tung
 
Introduction à ElasticSearch
Introduction à ElasticSearchIntroduction à ElasticSearch
Introduction à ElasticSearchFadel Chafai
 
[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험NHN FORWARD
 

Tendances (20)

Drools 6 deep dive
Drools 6 deep diveDrools 6 deep dive
Drools 6 deep dive
 
Créer des applications Java avec MongoDB
Créer des applications Java avec MongoDBCréer des applications Java avec MongoDB
Créer des applications Java avec MongoDB
 
Introduction aux bases de données NoSQL
Introduction aux bases de données NoSQLIntroduction aux bases de données NoSQL
Introduction aux bases de données NoSQL
 
Initiation à Android
Initiation à AndroidInitiation à Android
Initiation à Android
 
Génie Logiciel : les tests
Génie Logiciel : les testsGénie Logiciel : les tests
Génie Logiciel : les tests
 
Alphorm.com Formation Docker (1/2) : Installation et Administration
Alphorm.com Formation Docker (1/2) : Installation et AdministrationAlphorm.com Formation Docker (1/2) : Installation et Administration
Alphorm.com Formation Docker (1/2) : Installation et Administration
 
Decision Model and Notation (DMN) and Drools DMN support
Decision Model and Notation (DMN) and Drools DMN supportDecision Model and Notation (DMN) and Drools DMN support
Decision Model and Notation (DMN) and Drools DMN support
 
Support Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFISupport Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFI
 
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
 
Cours Big Data Chap4 - Spark
Cours Big Data Chap4 - SparkCours Big Data Chap4 - Spark
Cours Big Data Chap4 - Spark
 
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model ServingKubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
 
Rule Engine: Drools .Net
Rule Engine: Drools .NetRule Engine: Drools .Net
Rule Engine: Drools .Net
 
Support de cours angular
Support de cours angularSupport de cours angular
Support de cours angular
 
P4 intents
P4 intentsP4 intents
P4 intents
 
Chapitre 3 spark
Chapitre 3 sparkChapitre 3 spark
Chapitre 3 spark
 
Drools expert-docs
Drools expert-docsDrools expert-docs
Drools expert-docs
 
introduction à MongoDB
introduction à MongoDBintroduction à MongoDB
introduction à MongoDB
 
Apache zookeeper 101
Apache zookeeper 101Apache zookeeper 101
Apache zookeeper 101
 
Introduction à ElasticSearch
Introduction à ElasticSearchIntroduction à ElasticSearch
Introduction à ElasticSearch
 
[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험
 

En vedette

Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
 
Jboss drools 4 scope - benefits, shortfalls
Jboss drools   4 scope - benefits, shortfalls Jboss drools   4 scope - benefits, shortfalls
Jboss drools 4 scope - benefits, shortfalls Zoran Hristov
 
Rule Engine Evaluation for Complex Event Processing
Rule Engine Evaluation for Complex Event ProcessingRule Engine Evaluation for Complex Event Processing
Rule Engine Evaluation for Complex Event ProcessingChandra Divi
 
Knowledge is Power: Visualizing JIRA's Performance Data
Knowledge is Power: Visualizing JIRA's Performance DataKnowledge is Power: Visualizing JIRA's Performance Data
Knowledge is Power: Visualizing JIRA's Performance DataAtlassian
 
Business Rules en CRM - Aquima
Business Rules en CRM - AquimaBusiness Rules en CRM - Aquima
Business Rules en CRM - AquimaExploreDynCRM
 
BRM 2012 (Decision Tables)
BRM 2012 (Decision Tables)BRM 2012 (Decision Tables)
BRM 2012 (Decision Tables)Michael Anstis
 
Open source and business rules
Open source and business rulesOpen source and business rules
Open source and business rulesGeoffrey De Smet
 
Apache Beam (incubating)
Apache Beam (incubating)Apache Beam (incubating)
Apache Beam (incubating)Apache Apex
 
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + DemosDrools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + DemosMauricio (Salaboy) Salatino
 
The Next Generation of Data Processing and Open Source
The Next Generation of Data Processing and Open SourceThe Next Generation of Data Processing and Open Source
The Next Generation of Data Processing and Open SourceDataWorks Summit/Hadoop Summit
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info SheetMark Proctor
 
Intro to Drools - St Louis Gateway JUG
Intro to Drools - St Louis Gateway JUGIntro to Drools - St Louis Gateway JUG
Intro to Drools - St Louis Gateway JUGRay Ploski
 

En vedette (20)

Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
 
Rules With Drools
Rules With DroolsRules With Drools
Rules With Drools
 
Jboss drools 4 scope - benefits, shortfalls
Jboss drools   4 scope - benefits, shortfalls Jboss drools   4 scope - benefits, shortfalls
Jboss drools 4 scope - benefits, shortfalls
 
Rule Engine Evaluation for Complex Event Processing
Rule Engine Evaluation for Complex Event ProcessingRule Engine Evaluation for Complex Event Processing
Rule Engine Evaluation for Complex Event Processing
 
Knowledge is Power: Visualizing JIRA's Performance Data
Knowledge is Power: Visualizing JIRA's Performance DataKnowledge is Power: Visualizing JIRA's Performance Data
Knowledge is Power: Visualizing JIRA's Performance Data
 
Business Rules en CRM - Aquima
Business Rules en CRM - AquimaBusiness Rules en CRM - Aquima
Business Rules en CRM - Aquima
 
Governança SOA
Governança SOAGovernança SOA
Governança SOA
 
BRM 2012 (Decision Tables)
BRM 2012 (Decision Tables)BRM 2012 (Decision Tables)
BRM 2012 (Decision Tables)
 
Rules engine
Rules engineRules engine
Rules engine
 
Open source and business rules
Open source and business rulesOpen source and business rules
Open source and business rules
 
FOSS in the Enterprise
FOSS in the EnterpriseFOSS in the Enterprise
FOSS in the Enterprise
 
Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013
 
Apache Beam (incubating)
Apache Beam (incubating)Apache Beam (incubating)
Apache Beam (incubating)
 
Drools BeJUG 2010
Drools BeJUG 2010Drools BeJUG 2010
Drools BeJUG 2010
 
ieeecloud2016
ieeecloud2016ieeecloud2016
ieeecloud2016
 
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + DemosDrools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos
Drools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos
 
The Next Generation of Data Processing and Open Source
The Next Generation of Data Processing and Open SourceThe Next Generation of Data Processing and Open Source
The Next Generation of Data Processing and Open Source
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
Intro to Drools - St Louis Gateway JUG
Intro to Drools - St Louis Gateway JUGIntro to Drools - St Louis Gateway JUG
Intro to Drools - St Louis Gateway JUG
 

Similaire à Rules Programming tutorial

Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingSrinath Perera
 
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...WebStackAcademy
 
Flex 360 Rules Engine
Flex 360 Rules EngineFlex 360 Rules Engine
Flex 360 Rules EngineEffectiveUI
 
Flex 360 Rules Engine
Flex 360 Rules EngineFlex 360 Rules Engine
Flex 360 Rules EngineEffective
 
Smart solutions for productivity gain IQA conference 2017
Smart solutions for productivity gain   IQA conference 2017Smart solutions for productivity gain   IQA conference 2017
Smart solutions for productivity gain IQA conference 2017Steve Franklin
 
Obey The Rules: Implementing a Rules Engine in Flex
Obey The Rules: Implementing a Rules Engine in FlexObey The Rules: Implementing a Rules Engine in Flex
Obey The Rules: Implementing a Rules Engine in FlexRJ Owen
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql TuningChris Adkin
 
Webinar: Performance Tuning + Optimization
Webinar: Performance Tuning + OptimizationWebinar: Performance Tuning + Optimization
Webinar: Performance Tuning + OptimizationMongoDB
 
Guidelines and Best Practices for Sencha Projects
Guidelines and Best Practices for Sencha ProjectsGuidelines and Best Practices for Sencha Projects
Guidelines and Best Practices for Sencha ProjectsAmitaSuri
 
Unit testing best practices with JUnit
Unit testing best practices with JUnitUnit testing best practices with JUnit
Unit testing best practices with JUnitinTwentyEight Minutes
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql ServerDavid P. Moore
 
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTEJBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTEtsurdilovic
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Lari Hotari
 
Keeping business logic out of your UIs
Keeping business logic out of your UIsKeeping business logic out of your UIs
Keeping business logic out of your UIsPetter Holmström
 
JBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic PlatformJBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic Platformelliando dias
 
Neoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injectionNeoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injectionNeoito
 

Similaire à Rules Programming tutorial (20)

Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 Srping
 
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
Core Java Programming Language (JSE) : Chapter IV - Expressions and Flow Cont...
 
Flex 360 Rules Engine
Flex 360 Rules EngineFlex 360 Rules Engine
Flex 360 Rules Engine
 
Flex 360 Rules Engine
Flex 360 Rules EngineFlex 360 Rules Engine
Flex 360 Rules Engine
 
Smart solutions for productivity gain IQA conference 2017
Smart solutions for productivity gain   IQA conference 2017Smart solutions for productivity gain   IQA conference 2017
Smart solutions for productivity gain IQA conference 2017
 
Obey The Rules: Implementing a Rules Engine in Flex
Obey The Rules: Implementing a Rules Engine in FlexObey The Rules: Implementing a Rules Engine in Flex
Obey The Rules: Implementing a Rules Engine in Flex
 
Acceptance tests
Acceptance testsAcceptance tests
Acceptance tests
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql Tuning
 
Webinar: Performance Tuning + Optimization
Webinar: Performance Tuning + OptimizationWebinar: Performance Tuning + Optimization
Webinar: Performance Tuning + Optimization
 
Guidelines and Best Practices for Sencha Projects
Guidelines and Best Practices for Sencha ProjectsGuidelines and Best Practices for Sencha Projects
Guidelines and Best Practices for Sencha Projects
 
Unit testing best practices with JUnit
Unit testing best practices with JUnitUnit testing best practices with JUnit
Unit testing best practices with JUnit
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql Server
 
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTEJBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
 
algo 1.ppt
algo 1.pptalgo 1.ppt
algo 1.ppt
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014
 
Keeping business logic out of your UIs
Keeping business logic out of your UIsKeeping business logic out of your UIs
Keeping business logic out of your UIs
 
JBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic PlatformJBoss Drools - Open-Source Business Logic Platform
JBoss Drools - Open-Source Business Logic Platform
 
Drools rule Concepts
Drools rule ConceptsDrools rule Concepts
Drools rule Concepts
 
Neoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injectionNeoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injection
 
Grails services
Grails servicesGrails services
Grails services
 

Plus de Srinath Perera

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingSrinath Perera
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the EnterpriseSrinath Perera
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs Srinath Perera
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsSrinath Perera
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?Srinath Perera
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesSrinath Perera
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?Srinath Perera
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsSrinath Perera
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Srinath Perera
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of BlockchainSrinath Perera
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesSrinath Perera
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata EraSrinath Perera
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksSrinath Perera
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeSrinath Perera
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies TimelineSrinath Perera
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsSrinath Perera
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglySrinath Perera
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through AnalyticsSrinath Perera
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySrinath Perera
 

Plus de Srinath Perera (20)

Book: Software Architecture and Decision-Making
Book: Software Architecture and Decision-MakingBook: Software Architecture and Decision-Making
Book: Software Architecture and Decision-Making
 
Data science Applications in the Enterprise
Data science Applications in the EnterpriseData science Applications in the Enterprise
Data science Applications in the Enterprise
 
An Introduction to APIs
An Introduction to APIs An Introduction to APIs
An Introduction to APIs
 
An Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance ProfessionalsAn Introduction to Blockchain for Finance Professionals
An Introduction to Blockchain for Finance Professionals
 
AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?AI in the Real World: Challenges, and Risks and how to handle them?
AI in the Real World: Challenges, and Risks and how to handle them?
 
Healthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & ChallengesHealthcare + AI: Use cases & Challenges
Healthcare + AI: Use cases & Challenges
 
How would AI shape Future Integrations?
How would AI shape Future Integrations?How would AI shape Future Integrations?
How would AI shape Future Integrations?
 
The Role of Blockchain in Future Integrations
The Role of Blockchain in Future IntegrationsThe Role of Blockchain in Future Integrations
The Role of Blockchain in Future Integrations
 
Future of Serverless
Future of ServerlessFuture of Serverless
Future of Serverless
 
Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going? Blockchain: Where are we? Where are we going?
Blockchain: Where are we? Where are we going?
 
Few thoughts about Future of Blockchain
Few thoughts about Future of BlockchainFew thoughts about Future of Blockchain
Few thoughts about Future of Blockchain
 
A Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New TechnologiesA Visual Canvas for Judging New Technologies
A Visual Canvas for Judging New Technologies
 
Privacy in Bigdata Era
Privacy in Bigdata  EraPrivacy in Bigdata  Era
Privacy in Bigdata Era
 
Blockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and RisksBlockchain, Impact, Challenges, and Risks
Blockchain, Impact, Challenges, and Risks
 
Today's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology LandscapeToday's Technology and Emerging Technology Landscape
Today's Technology and Emerging Technology Landscape
 
An Emerging Technologies Timeline
An Emerging Technologies TimelineAn Emerging Technologies Timeline
An Emerging Technologies Timeline
 
The Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming ApplicationsThe Rise of Streaming SQL and Evolution of Streaming Applications
The Rise of Streaming SQL and Evolution of Streaming Applications
 
Analytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the UglyAnalytics and AI: The Good, the Bad and the Ugly
Analytics and AI: The Good, the Bad and the Ugly
 
Transforming a Business Through Analytics
Transforming a Business Through AnalyticsTransforming a Business Through Analytics
Transforming a Business Through Analytics
 
SoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration TechnologySoC Keynote:The State of the Art in Integration Technology
SoC Keynote:The State of the Art in Integration Technology
 

Rules Programming tutorial

  • 1. Programming With Rules Srinath Perera, Ph.D. Architect, WSO2 Inc.
  • 2. Rule based Systems ● Expert Systems / Business rules engine / Production Systems / Inference Engines are used to address rule engines based on their implementations and use. ● Something most people like to have, although not many people know why they need it.
  • 3. Rules ● Allow users to specify the requirements/ knowledge about processing using – Declarative (Say what should happen, not how to do it) – Logic based languages.
  • 4. Types of Rules ● Four types of rules (from http://www.w3.org/2000/10/swap/doc/rule-systems) – Derivation or Deduction Rules – Each rules express if some statements are true, another statement must be true. Called logical implication. E.g. Prolog – Transformation Rules- transform between knowledge bases, e.g. theorem proving – Integrity Constraints – verification rules – Reaction or Event-Condition-Action (ECA) Rules – includes a actions in addition to inference. e.g. Drools
  • 5. Two types of Rule Engines ● Forward Chaining – starts with facts/data and trigger actions or output conclusions ● Backward chaining – starts with goals and search how to satisfy that (e.g. Prolog)
  • 6. Production Systems ● Drools belongs to the category of rule engines called production systems [1] (which execute actions based on conditions) ● Drools use forward chaining[2] (start with data and execute actions to infer more data ) ● Priorities assigned to rules are used to decide the order of rule execution ● They remember all results and use that to optimize new derivations (dynamic programming like) http://en.wikipedia.org/wiki/AI_production http://en.wikipedia.org/wiki/Forward_chaining
  • 7. Big Picture ● Usually a Rule engine usually includes three parts. – Facts represented as working memory – Set of rules that declaratively define conditions or situations e.g. Prolog route(X,Z) <- road(X,Z) – Actions executed or inference derived based on the rules
  • 8. Why rule engines? ● Simplify complicated requirements with declarative logic, raising the level of abstraction of the system ● Externalize the business logic (which are too dynamic) from comparatively static code base ● Intuitive and readable than code, easily understood by business people/ non technical users http://en.wikipedia.org/wiki/AI_production http://en.wikipedia.org/wiki/Forward_chaining
  • 9. Why rule engines? [Contd.] ● Create complex interactions which can have powerful results, even from simple facts and rules. ● Different approach to the problem, some problem are much easier using rules. ● Can solve hard problems (Problems we only understand partially) ● Fast and scalable when there is a data set that changes little by little
  • 10. When to use Rules? ● When there is no satisfactory traditional programming approach to solve the problem! ● To separate code and business logic ● The problem is beyond any obvious algorithmic solution. (not fully understood) ● When the logic changes often ● When Domain experts are none technical. 1. Real-World Rule Engines http://www.infoq.com/articles/Rule-Engines 2. Why are business rules better than traditional code? http://www.edmblog.com/weblog/2005/11/why_are_busines.html 3. Rules-based Programming with JBoss Rules/Drools www.codeodor.com
  • 11. When not to use rule engines? ● It is slower then usual code most of the time, so unless one of the following is true is should not be used – Complexity of logic is hard to tackle – Logic changes too often – Required to use by non technical users – It is a usecase where rules are faster. ● Interactions between rules could be quite complex, and one mistake could change the results drastically and unexpected way e.g. recursive rules ● Due to above testing and debugging is required, so if results are hard to verified it should not be used.
  • 12. Drools Rule Engine ● Forward chaining, production system based on Rete algorithm. ● Written in Java, and support OOP based model ● Open source/ Apache License compatible ● Backed up JBoss, also called JBoss rules ● Link http://jboss.org/drools
  • 13. Model ● Facts as a Object repository of java objects ● New objects can be added, removed or updated ● support if <query> then <action> type rules ● Queries use OOP format
  • 15. Anatomy of a Rule ● Has two parts rule "rule-name" when <query in a Object query language> then <any java code> end ● When condition is satisfied, action is carried out.
  • 16. Business Rules ● Working Memory – Insert, retract, update ● Stateful sessions ● Stateless sessions ● Queries - QueryResults results = ksession.getQueryResults( "my query", new Object[] { "string" } ); ● Globals ksession.setGlobal("list", list); ● Agenda filters makes sure only selected rules are fired. ksession.fireAllRules( new RuleNameEndsWithAgendaFilter( "Test" ) );
  • 17. Rete Algorithm ● Dr Charles L. Forgy's Ph.D. Thesis, 1974 ● Creates a tree representing rules, and data propagate through the tree and out put actions. ● Partial results are saved in memory.
  • 18. A Sample Rule Following rule increase the premium by 15% if driver is less than 25 and drives a sport car. rule "MinimumAge" when $d : Customer(age < 25) $c : Car(vin=$d.vin && model = “sport”) then c.IncreasePrimium(15); end
  • 19. Actions ● Any java code goes in the then clause ● Also support some level of scripts ● Operations on working memory – update(object); will tell the engine that an object has changed – insert(new Something()); will place a new object of your creation into the Working Memory. – insertLogical(new Something()); is similar to insert, but the object will be automatically retracted when there are no more facts to support the truth of the currently firing rule. – retract(handle); removes an object from Working Memory.
  • 20. Rule Patterns Following rule reject all customers whose age less than 17. rule "MinimumAge" when c : Customer(age < 17) then c.reject(); end Conditions support <, >, ==, <=, >=, matches / not matches, contains / not contains. And following rules provide a discount if customer is married or older than 25. rule "Discount" when c : Customer( married == true || age > 25) then c.addDiscount(10); end
  • 21. Joins Following rule increase the premium by 15% if driver is less than 25 and drives a sport car. rule "MinimumAge" when $d : Customer(age < 25) $c : Car(vin=$d.vin && model = “sport”) then c.IncreasePrimium(15); end
  • 22. Bound variables Bound variables when Person( likes : favouriteCheese ) Cheese( type == likes ) then … end
  • 23. OR, AND ● OR – true if either of the statements true – E.g. Customer(age > 50) or Vehicle( year > 2000) ● AND – provide logical, if no connectivity is define between two statements, “and” is assumed by default. For an example. c : Customer( timeSinceJoin > 2); not (Accident(customerid == c.name)) and c : Customer( timeSinceJoin > 2) and not (Accident(customerid == c.name)) are the same.
  • 24. eval(..) ● eval(boolean expressions) – with eval(..) any Boolean expression can be used. – E.g. C:Customer(age > 20) eval(C.calacuatePremium() > 1000) ● Can not hold partial results for eval(..) so Drools going to recalculate eval(..) statements and what ever trigged from that. ● So it is going to be inefficient, so use sparingly
  • 25. Not ● Not – negation or none can be found. E.g. not Plan( type = “home”) is true if no plan of type home is found. Following is true if customer has take part in no accidents. rule "NoAccident" when c : Customer( timeSinceJoin > 2); not (Accident(customerid == c.name)) then c.addDiscount(10); end
  • 26. For all ● True if all objects selected by first part of the query satisfies rest of the conditions. For an example following rule give 25 discount to customers who has brought every type of plans offered. rule "OtherPlans" when forall ($plan : PlanCategory() c : Customer(plans contains $plan)) then c.addDiscount(25); end
  • 27. Exists ● True if at least one matches the query, ● This is Different for just having Customer(), which is like for each which get invoked for each matching set. ● Following rule give a discount for each family where two members having plans rule “FamilyMembers" when $c : Customer() exists (Customer( name contains $c.family)) then c.addDiscount(5); end
  • 28. From ● True if at least one matches the query, ● This is Different for just having Customer(), which is like for each which get invoked for each matching set. ● Following rule give a discount for each family where two members having plans rule "validate zipcode" when Person( $personAddress : address ) Address( zipcode == "23920W") from $personAddress then # zip code is ok end
  • 29. Collect ● True if at least one matches the query, ● This is Different for just having Customer(), which is like for each which get invoked for each matching set. ● Following rule give a discount for each family where two members having plans rule "Raise priority if system has more than 3 pending alarms" when $system : System() $alarms : ArrayList( size >= 3 ) from collect( Alarm( system == $system, status == 'pending' ) ) then # Raise priority, because system $system has # 3 or more alarms pending. The pending alarms # are $alarms. end
  • 30. Accumulate ● True if at least one matches the query, ● This is Different for just having Customer(), which is like for each which get invoked for each matching set. ● Following rule give a discount for each family where two members having plans rule "Apply 10% discount to orders over US$ 100,00" when $order : Order() $total : Number( doubleValue > 100 ) from accumulate( OrderItem( order == $order, $value : value ), init( double total = 0; ), action( total += $value; ), reverse( total -= $value; ), result( total ) ) then # apply discount to $order end
  • 31. Conflict resolution • Each rule may define attributes There are other parameters you can found from [1]. E.g. rule "MinimumAge" salience = 10 when c : Customer(age < 17) then c.reject(); end • salience define priority of the rule and decide their activation order. 1. http://labs.jboss.com/drools/documentation.html
  • 32. WSO2 Deployment as an Example ● There are our product Instances (e.g. WSAS, Greg, IS, ESB) etc, which has been mapped to a facts in the rule system, and it is updated using a system management solution. ● They have a role property, that says what is there role. e.g. ESB role=”lb” means it is a load balancer. ● Each host is represented by Host() object, and each server have a property called host. ● Each server has a state, which is Up, Down
  • 33. Question 1: ● A system is considered healthy if there is One ESB, two WSAS instances, one load balance instance, one BPS server, and one Identity server. ● Write a rule to detect if system is healthy and print it. When ESB(role !=”lb”); List(size ==2) from collect (WSAS()); ESB(role==”lb”); BPS(); IS(); then System.out.println(“System Healthy”); end
  • 34. Question 2: ● If any server has failed but the host is up, restart the server using a rule. Assume there is system.restart(service-name, host). When wsas:WSAS(state=”Down”); host:Host(state=”Up” && wsas.host=name); then system.restart(wsas); end
  • 35. Question 3: ● If a host has failed, start the servers in the host using a rule. Assume there is system.start(service-name, host). When wsas:WSAS(); host:Host(state=”Down” && wsas.host=name); then system.start(wsas); end
  • 36. Question 4: ● Assume there are cluster of 10 WSAS nodes, if the average TPS is > 300, add a new node to the cluster. Assume WASA expose TPS via a property called tps. rule "Apply 10% discount to orders over US$ 100,00" when $order : Order() $total : Number( doubleValue > 300) from accumulate( WSAS( $tps : tps), init( double tpstot = 0; int count = 0; ), action( tpstot += $tps; count++ ), reverse( tpstot -= $tps; count-- ), result( tpstot/count ) ) then # apply discount to $order end
  • 37. Drools Performance • Measuring Rule engine performance is tricky. • Main factors are number of objects and number of rules. But results depends on nature of rules. • A user feedback [1] claims Drools about 4 times faster than JRules [4]. (SequentialRete) rules Objects Drools JRules 1219 100 4ms/4ms 16ms/15ms • [2] shows a comparison between Drools, Jess [5] and Microsoft rule engine. Overall they are comparable in performance. 1. http://blog.athico.com/2007/08/drools-vs-jrules-performance-and-future.html 2. http://geekswithblogs.net/cyoung/articles/54022.aspx 1. Jess - http://herzberg.ca.sandia.gov/jess/ 2. JRules http://www.ilog.com/products/jrules/
  • 38. Drools Performance Contd. I have ran the well known rule engine bench mark [1] implementation provided with Drools. (On linbox3 - 1GB memory, 4 CPU • 3.20GHz ) Bench Marks Rule Count Object Time (ms) Count Waltz 31 958 1582 31 3873 9030 Waltz DB 34 393 420 34 697 956 34 1001 1661 34 1305 2642 http://www.cs.utexas.edu/ftp/pub/ops5-benchmark-suite/HOW.TO.USE 1.