JUDCon India 2012 Drools Expert

Mark Proctor
Mark ProctorPlatform Architect - Red Hat BRMS and BPMS
1




     Mark
    Proctor
   Project Lead




The SkyNet funding bill is passed.
The system goes online on August 4th, 1997.
Human decisions are removed from strategic defense.
SkyNet begins to learn at a geometric rate.
It becomes self-aware at 2:14am Eastern time, August 29th
In a panic, they try to pull the plug.
And, Skynet fights back
2
Wumpus World
3
Wumpus World
4
Wumpus World

C e ll         H e ro         Wu m p u s    P itt             G old
     int row        int row       int row           int row       int row
     Int col        Int col       Int col           Int col       Int col
5
Wumpus World
6
Wumpus World
7
Wumpus World



 d e m ons tration
8

Drools B ooks
9
S ample Indus tries and Us ers

   Inve s tm e nt
       Mille nniu m Inve s tm e nt G rou p (M IG )
   Logis tics
       Fed ex
   Airline
       S ab re
   M ortgage
       F ranklin Am e rican
   H e alth care
       OSDE
10
B oot C amps




   S an F rancis co 2009 (40+ atte nd e e s )
       S p ons ore d b y Th ird P illar
       S u n, F AM C , O S D E , Kas e ya, F e d e x, TU G rou p , Inte rm ou ntain
          H e alth care , G ap , S ony P ictu re s , Lockh e e d Martin, Kais e r, H P ,
          We lls F argo, U S N avy R e s e arch , F O LIO fn, Boe ing .....
   S an D ie go 201 0 (80+ atte nd e s s )
       S p ons ore d b y U S N avy
       5 d ay e ve nt, with 2 d ays focu s on th e h e alth care ind u s try
       O S D E , AT&T, S AIC , U S N avy R e s e arch , Kais e r, C linica,
         Inte rm ou ntain H e alth care , G E H e alth care , VA, Boe ing,
         N ationwid e ....
11
Integrated S ys tems




               Rules       Rules   Workflows   Workflows

                                 Event
                               Processes

                              Semantic
                              Ontologies


                                                 Semantic
                 Event                           Ontologies
               Processes
12
generic                 Rules and proces s es




                                     ?
                                                  Decision
                                                  Services
SCOPE




                Process
specific




                 Rules




           tightly coupled           COUPLING   loosely coupled
13
Integrated S ys tems




      Drools          JBPM5                Drools          Drools
      Expert       (Drools Flow)           Fusion          Guvnor




      Drools             Drools           Drools           Drools
      Planner             Grid           Semantics         Chance


                       Business Logic integration System
14
                   Declarative Programming

P rod u ction R u le S ys te m s P R D (forward ch aining)
    R e active
    wh e n Alarm ( s tatu s = = “ale rt” )
      th e n s e nd ( “warning” )
Logic P rogram m ing LP (b ackward ch aining)
    Q u e ry
    d e s ce nd ant( “m ary”, “j ”)
                                ane
F u nctional P rogram m ing F P
    Map ,F old , F ilte r
    avg([1 2, 1 6, 4, 6])
         R e tu rns s ingle valu e 9.5
    rou nd ([1 0.3, 4.7, 7.8] )
         R e tu rns Lis t [1 0, 5, 8]
D e s crip tion Logic
    P e rs on H as N am e and
15
         C las s es


                                                       C a s h f lo w
     A cco u n t
                                                  D a te d a te
lo n g a c c o u n t N o
                                                  d o u b le a m o u n t
d o u b le b a la n c e
                                                  in t t y p e
                                                  lo n g a c c o u n t N o




                           A c c o u n t in g P e r io d

                           D a te s ta r t
                           D a te e n d
16
             C redit C as hflow Rule


 select * from Account acc,
      Cashflow cf, AccountPeriod ap
 where acc.accountNo == cf.accountNo and
       cf.type == CREDIT
       cf.date >= ap.start and
       cf.date <= ap.end
 trigger : acc.balance += cf.amount


rule “increase balance for AccountPeriod Credits”
    when
        ap : AccountPeriod()
        acc : Account( $accountNo : accountNo )
        CashFlow( type == CREDIT,
                          accountNo == $accountNo,
                          date >= ap.start && <= ap.end,
                          $ammount : ammount )
    then
        acc.balance += $amount;
end
17
                         Rules as a “ view”

  CashFlow                                                  AccountingPeriod
         date       amount           type       accountNo         start               end
  12-Jan-07                  100 CREDIT     1                   01-Jan-07          31-Mar-07
  2-Feb-07                   200 DEBIT      1
  18-May-07                   50 CREDIT     1               Account
  9-Mar-07                    75 CREDIT     1                  accountNo             balance
                                                            1                  0
rule “increase balance for AccountPeriod    rule “decrease balance for AccountPeriod
       Credits”                                    Debits”
  when                                        when
    ap : AccountPeriod()                        ap : AccountPeriod()
    acc : Account( $accountNo : accountNo )     acc : Account( $accountNo : accountNo )

    CashFlow( type == CREDIT,                     CashFlow( type == DEBIT,
                accountNo == $accountNo,                     accountNo == $accountNo,
                date >= ap.start && <= ap.end,               date >= ap.start && <= ap.end,
                $ammount : ammount )                         $ammount : ammount )
  then                                          then
    acc.balance += $amount;                       acc.balance -= $amount;
end CashFlow                                  end CashFlow
           date         amount        type                date         amount         type
    12-Jan-07                  100 CREDIT          2-Feb-07                   200 DEBIT
    9-Mar-07                    75 CREDIT

  Account
     accountNo           balance
  1                -25
18
         Definitions


p u b lic clas s Ap p licant {
     p rivate S tring    nam e ;
     p rivate int         age ;
     p rivate b oole an valid ;
     / ge tte r and s e tte r m e th od s h e re
      /
}

    rule "Is of valid age" when
       $a : Applicant( age < 18 )
    then
       modify( $a ) { valid = false };
    ends
19
                          B uilding

Knowle d ge Bu ild e r kb u ild e r = Knowle d ge Bu ild e rF actory.ne wK nowle d ge Bu ild e r();


kb u ild e r.ad d ( R e s ou rce F actory
                    .ne wC las s P ath R e s ou rce ( "lice ns e Ap p lication.d rl", ge tC las s () ),
                                                        R e s ou rce Typ e .D R L );


if ( kb u ild e r.h as E rrors () ) {
    S ys te m .e rr.p rintln( kb u ild e r.ge tE rrors ().toS tring() );
}


kb as e .ad d K nowle d ge P ackage s ( kb u ild e r.ge tKnowle d ge P ackage s () );
20
S pring C onfiguration
21
                          E xecuting

 rule "Is of valid age" when
    $a : Applicant( age < 18 )
 then
    modify( $a ) { valid = false };
 ends

S tate le s s K nowle d ge S e s s ion ks e s s ion = kb as e .ne wS tate le s s Knowle d ge S e s s ion();
Ap p licant ap p licant = ne w Ap p licant( "M r Joh n S m ith ", 1 6 );
as s e rtTru e ( ap p licant.is Valid () );


ks e s s ion.e xe cu te ( ap p licant );


as s e rtF als e ( ap p licant.is Valid () );
22
                    Definitions

p u b lic clas s R oom {
    p rivate S tring nam e
    / ge tte r and s e tte r m e th od s h e re
     /
}
p u b lic clas s S p rinkle r {
    p rivate R oom room ;
    p rivate b oole an on;
    / ge tte r and s e tte r m e th od s h e re
     /
}
p u b lic clas s F ire {
    p rivate R oom room ;
    / ge tte r and s e tte r m e th od s h e re
     /
}
p u b lic clas s Alarm {
23
                     Definitions
ru le "Wh e n th e re is a fire tu rn on th e s p rinkle r" wh e n
    F ire ($room : room )
    $s p rinkle r : S p rinkle r( room = = $room , on = = fals e )
th e n
    m od ify( $s p rinkle r ) { on = tru e };
    p rintln( "Tu rn on th e s p rinkle r for room " + $room .nam e );
e nd
ru le "Wh e n th e fire is gone tu rn off th e s p rinkle r" wh e n
   $room : R oom ( )
   $s p rinkle r : S p rinkle r( room = = $room , on = = tru e )
   not F ire ( room = = $room )
th e n
   m od ify( $s p rinkle r ) { on = fals e };
   p rintln( "Tu rn off th e s p rinkle r for room " + $room .nam e );
24
                       Definitions

ru le "R ais e th e alarm wh e n we h ave one or m ore fire s " wh e n
   e xis ts F ire ()
th e n
   ins e rt( ne w Alarm () );
   p rintln( "R ais e th e alarm " );
e nd
ru le "C ance l th e alarm wh e n all th e fire s h ave gone " wh e n
   not F ire ()
   $alarm : Alarm ()
th e n
   re tract( $alarm );
   p rintln( "C ance l th e alarm " );
e nd
25
                   Definitions


ru le "S tatu s ou tp u t wh e n th ings are ok" wh e n
   not Alarm ()
   not S p rinkle r( on = = tru e )
th e n
   p rintln( "E ve ryth ing is ok" );
e nd
26
                          E xecuting

S tring[] nam e s = ne w S tring[]{"kitch e n", "b e d room ", "office ", "livingroom "};
M ap < S tring,R oom > nam e 2room = ne w H as h M ap < S tring,R oom > ();


for( S tring nam e : nam e s ){
    R oom room = ne w R oom ( nam e );
    nam e 2room .p u t( nam e , room );
    ks e s s ion.ins e rt( room );
    S p rinkle r s p rinkle r = ne w S p rinkle r( room );
    ks e s s ion.ins e rt( s p rinkle r );
}


ks e s s ion.fire AllR u le s ()

> E ve ryth ing is ok
27
                          E xecuting

F ire kitch e nF ire = ne w F ire ( nam e 2room .ge t( "kitch e n" ) );
F ire office F ire = ne w F ire ( nam e 2room .ge t( "office " ) );


F actH and le kitch e nF ire H and le = ks e s s ion.ins e rt( kitch e nF ire );
F actH and le office F ire H and le = ks e s s ion.ins e rt( office F ire );


ks e s s ion.fire AllR u le s ();


> R ais e th e alarm
> Tu rn on th e s p rinkle r for room kitch e n
> Tu rn on th e s p rinkle r for room office
28
                           E xecuting

ks e s s ion.re tract( kitch e nF ire H and le );
ks e s s ion.re tract( office F ire H and le );


ks e s s ion.fire AllR u le s ()

 > Tu rn off th e s p rinkle r for room office
 > Tu rn off th e s p rinkle r for room kitch e n
 > C ance l th e alarm
 > E ve ryth ing is ok

 ru le "S tatu s ou tp u t wh e n th ings are ok" wh e n
     not Alarm ()
     not S p rinkle r( on = = tru e )
 th e n
     p rintln( "E ve ryth ing is ok" );
29
             C onditional E lements



not Bus( color = “red” )


exists Bus( color = “red” )


forall ( $bus : Bus( color == “red” ) )


forall ( $bus : Bus( floors == 2 )
               Bus( this == $bus, color == “red” ) )
30
A ccumulate C E

 ru le "accu m u late "
 wh e n
    $s u m : N u m b e r( intValu e > 1 00 )
             from accu m u late ( Bu s ( color = = "re d ", $t : takings )
                                     s u m ( $t ) )
 th e n
    p rint "s u m is “ + $s u m ;
 e nd
31
Decis ion Table
32
           Decis ion Table




rule "Pricing bracket_10"

when
   Driver(age >= 18, age <= 24,
          locationRiskProfile == "LOW",
          priorClaims == "1")
   policy:
   Policy(type == "COMPREHENSIVE")
then
   policy.setBasePrice(450);
33
Types



   Types
    Layou t
           H orizontal
           Ve rtical
           Lim ite d e ntry
           E xte nd e d e ntry
    C ate goris ation
           E xp and e d form , contracte d form
           M u lti-h it, all h its
           M u lti-h it, firs t h it
           S ingle h it
34
Layouts



   Horizontal
35
Layouts



   Vertical
36
Layouts



   Limited entry
37
Layouts



   E xtended entry
38
C ategoris ation




    E xpanded form
    S ingle colu m n for e ve ry cond ition com b ination
    Th e nu m b e r of colu m ns s h ou ld e qu al th e p rod u ct of
      th e nu m b e r of s tate s for e ve ry cond ition.
       e .g. 2 cond itions , one with 3 s tate s th e oth e r 4 (s e e ab ove ):
                                  3 * 4 = 1 2 com b inations
       e .g. 2 cond itions e ach with 3 s tate s and 1 cond ition with 4 s tate s give s :
                                3 * 3 * 4 = 36 com b inations
39
C ategoris ation



    E xpanded form (continued)
40
C ategoris ation



    C ontracted form
    C ontraction is th e firs t op tim is ation.
    R e d u ce s th e nu m b e r of cond ition colu m ns .
    R e m ove s im p os s ib le com b inations
    If th e s am e actions e xis t for ru le s cove ring all
       cond ition s tate s for a give n cond ition th e y can b e
       com b ine d and th e cond ition s tate b e com e s
       irre le vant.
41
C ategoris ation



    C ontracted form – s tage 1
    R u le s 2 and 3 are im p os s ib le cond itions
42
C ategoris ation



    C ontracted form – s tage 2
    M e rge ad j nt colu m n grou p s with id e ntical action p arts
                ace
43
C ategoris ation



    Multi-hit, all hits
    To ge t com p le te re s u lt all ru le s m atch ing ne e d to h ave
      th e ir actions e xe cu te d .
    C ond ition colu m ns are not m u tu ally e xclu s ive
    If th e C ond ition colu m ns are not e xclu s ive , s om e
       com b ination of cond itions are p re s e nt in m ore th an
       one colu m n, wh ich m ay le ad to am b igu ity or
       incons is te ncy.
44
C ategoris ation



    Multi-hit, all hits




    G ive n a 35 ye ar old with 1 5 ye ars s e rvice
    1 . R u le 1 m atch e s , giving 22 d ays
    2. R u le 5 m atch e s , giving an ad d itional 3 d ays
    3. A total of 25 d ays is as s igne d
45
C ategoris ation



    Multi-hit, firs t hit
    To ge t com p le te re s u lt th e firs t ru le (from le ft-to-righ t)
      m atch ing ne e d s to h ave its action e xe cu te d .
    C ond ition colu m ns are not m u tu ally e xclu s ive .
    If th e C ond ition colu m ns are not e xclu s ive , s om e
       com b ination of cond itions are p re s e nt in m ore th an
       one colu m n, wh ich m ay le ad to am b igu ity or
       incons is te ncy.
46
C ategoris ation



    Multi-hit, firs t hit




    G ive n a 35 ye ar old with 1 5 ye ars s e rvice
    1 . R u le 4 m atch e s , giving 25 d ays
    2. R u le 6 wou ld m atch b u t R u le 4 was th e firs t h it
47
C ategoris ation



    S ingle hit
    E ach p os s ib le com b ination of cond itions m atch e s
       e xactly one , and only one , ru le .
    C ond ition colu m ns are m u tu ally e xclu s ive
    As th e C ond ition colu m ns are e xclu s ive ; com b inations
      of cond itions cannot b e p re s e nt in m ore th an one
      colu m n wh ich e lim inate s am b igu ity and
      incons is te ncy.
    C las s ic form if S ingle -h it is "e xp and e d d e cis ion tab le ";
       b u t th is can b e op tim is e d or “contracte d ”.
48
C ategoris ation



    S ingle hit




    G ive n a 35 ye ar old with 1 5 ye ars s e rvice
    1 . R u le 3 m atch e s , giving 25 d ays
    2. N o oth e r ru le s m atch
49
Validation & Verification



   Redundancy - S ubs umption
50
Validation & Verification



   Deficiency
       P re m iu m is £500 if ap p licant age is le s s th an 30

       P re m iu m is £300 if Ye ars With ou t C laim is gre ate r th an or e qu al to 1 0 ye ars .




       Ap p licant is 29, p re m iu m is £500

       Ap p licant h as 1 2 ye ars with ou t claim , p re m iu m is £300

       Ap p licant is 29 with 1 2 ye ars with ou t claim , p re m iu m is ?!?
51
Decis ion Tables in G uvnor




   Vid e o d e m ons tration
52
Guided Editor
53
Decision Table
54
Decision Table
55
Decision Table
56

Decision Tables – Cell merging.. etc

                                Cell Merging




                                Cell Grouping
                                Typed Columns
                                Sorting by column



                                Negate pattern
                                Support for Ohterwise
57

Decision Tables – Wizard
58
Rule Templates
59
Rule Templates
60
Rule Templates
61
Scenario Testing
62
TMS and Inference

  ru le "Is s u e C h ild Bu s P as s "              Couples the logic
  wh e n
   $p : P e rs on( age < 1 6 )
  th e n
   ins e rt(ne w C h ild Bu s P as s ( $p ) );
  e nd
  ru le "Is s u e Ad u lt Bu s P as s "          What happens when the Child
                                                       stops being 16?
  wh e n
   $p : P e rs on( age > = 1 6 )
  th e n
   ins e rt(ne w Ad u ltBu s P as s ( $p ) );
  e nd
63
TMS and Inference

  Bad
        Monolith ic
        Le aky
        Brittle inte grity - m anu al m ainte nance
64
TMS and Inference

  A ru le “logically” ins e rts an ob j ct
                                      e
  Wh e n th e ru le is no longe r tru e , th e ob j ct is re tracte d .
                                                  e
  wh e n
                                                      de-couples the logic
   $p : P e rs on( age < 1 6 )
  th e n
     logicalIns e rt( ne w Is C h ild ( $p ) )
  e nd
  wh e n                                         Maintains the truth by
                                                 automatically retracting
   $p : P e rs on( age > = 1 6 )
  th e n
     logicalIns e rt( ne w Is Ad u lt( $p ) )
  e nd
65
TMS and Inference

  ru le "Is s u e C h ild Bu s P as s "
  wh e n
   $p : P e rs on( )
           Is C h ild ( p e rs on = $p )
  th e n
   logicalIns e rt(ne w C h ild Bu s P as s ( $p ) );
  e nd
                                                    The truth maintenance
  ru le "Is s u e Ad u lt Bu s P as s "                   cascades
  wh e n
   $p : P e rs on( age > = 1 6 )
           Is Ad u lt( p e rs on = $p )
  th e n
   logicalIns e rt(ne w Ad u ltBu s P as s ( $p ) );
  e nd
66
TMS and Inference

  ru le "Is s u e C h ild Bu s P as s "
  wh e n
   $p : P e rs on( )
           not( C h ild Bu s P as s ( p e rs on = = $p ) )
  th e n
     re qu e s tC h ild Bu s P as s ( $p );                  The truth maintenance
                                                                   cascades
  e nd
67
TMS and Inference

  G ood
      D e -cou p le knowle d ge re s p ons ib ilitie s
      E ncap s u late knowle d ge
      P rovid e s e m antic ab s tractions for th os e e ncap s u lation
      Inte grity rob u s tne s s – tru th m ainte nance
68
                   Ques tions ?


                              D ave Bowm an: All righ t, H AL; I'll go in
                              th rou gh th e e m e rge ncy airlock.
                              H AL: With ou t you r s p ace h e lm e t, D ave ,
                              you 're going to find th at rath e r d ifficu lt.
                              D ave Bowm an: H AL, I won't argu e with
                              you anym ore ! O p e n th e d oors !
                              H AL: D ave , th is conve rs ation can s e rve
                              no p u rp os e anym ore . G ood b ye .



essor Falken.
oshua.
 . The only winning move is not to play. How about a nice game of chess
1 of 68

Recommended

Drools Expert and Fusion Intro : London 2012 by
Drools Expert and Fusion Intro  : London 2012Drools Expert and Fusion Intro  : London 2012
Drools Expert and Fusion Intro : London 2012Mark Proctor
5.6K views57 slides
Hybrid rule engines (rulesfest 2010) by
Hybrid rule engines (rulesfest 2010)Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)Geoffrey De Smet
1.2K views59 slides
Developing applications with rules, workflow and event processing (it@cork 2010) by
Developing applications with rules, workflow and event processing (it@cork 2010)Developing applications with rules, workflow and event processing (it@cork 2010)
Developing applications with rules, workflow and event processing (it@cork 2010)Geoffrey De Smet
2.5K views100 slides
Lille2010markp by
Lille2010markpLille2010markp
Lille2010markpCh'ti JUG
1.4K views89 slides
Buenos Aires Drools Expert Presentation by
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationMark Proctor
1.7K views63 slides
Drools Introduction by
Drools IntroductionDrools Introduction
Drools IntroductionJBug Italy
2.4K views28 slides

More Related Content

What's hot

Drools and BRMS 6.0 (Dublin Aug 2013) by
Drools and BRMS 6.0 (Dublin Aug 2013)Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)Mark Proctor
2.3K views160 slides
Learning Rule Based Programming using Games @DecisionCamp 2016 by
Learning Rule Based Programming using Games @DecisionCamp 2016Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016Mark Proctor
1.2K views84 slides
Classic Games Development with Drools by
Classic Games Development with DroolsClassic Games Development with Drools
Classic Games Development with DroolsMark Proctor
2.2K views55 slides
2012 02-04 fosdem 2012 - drools planner by
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools plannerGeoffrey De Smet
1.5K views99 slides
Introduction to Drools by
Introduction to DroolsIntroduction to Drools
Introduction to Droolsgiurca
3.9K views22 slides
RicoLiveGrid by
RicoLiveGridRicoLiveGrid
RicoLiveGridtutorialsruby
288 views10 slides

What's hot(6)

Drools and BRMS 6.0 (Dublin Aug 2013) by Mark Proctor
Drools and BRMS 6.0 (Dublin Aug 2013)Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)
Mark Proctor2.3K views
Learning Rule Based Programming using Games @DecisionCamp 2016 by Mark Proctor
Learning Rule Based Programming using Games @DecisionCamp 2016Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016
Mark Proctor1.2K views
Classic Games Development with Drools by Mark Proctor
Classic Games Development with DroolsClassic Games Development with Drools
Classic Games Development with Drools
Mark Proctor2.2K views
2012 02-04 fosdem 2012 - drools planner by Geoffrey De Smet
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner
Geoffrey De Smet1.5K views
Introduction to Drools by giurca
Introduction to DroolsIntroduction to Drools
Introduction to Drools
giurca3.9K views

Viewers also liked

Drools5 Community Training: Module 1.5 - Drools Expert First Example by
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleDrools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleMauricio (Salaboy) Salatino
4K views24 slides
BRM 2012 (Decision Tables) by
BRM 2012 (Decision Tables)BRM 2012 (Decision Tables)
BRM 2012 (Decision Tables)Michael Anstis
2.3K views25 slides
Drools 6.0 (Red Hat Summit) by
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
37.4K views189 slides
2012 02-04 fosdem 2012 - guvnor and j bpm designer by
2012 02-04 fosdem 2012 - guvnor and j bpm designer 2012 02-04 fosdem 2012 - guvnor and j bpm designer
2012 02-04 fosdem 2012 - guvnor and j bpm designer marcolof
1.8K views62 slides
JUDCon India 2012 Drools Fusion by
JUDCon  India 2012 Drools FusionJUDCon  India 2012 Drools Fusion
JUDCon India 2012 Drools FusionMark Proctor
2.2K views68 slides
Drools and jBPM 6 Overview by
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
20.1K views106 slides

Viewers also liked(6)

BRM 2012 (Decision Tables) by Michael Anstis
BRM 2012 (Decision Tables)BRM 2012 (Decision Tables)
BRM 2012 (Decision Tables)
Michael Anstis2.3K views
Drools 6.0 (Red Hat Summit) by Mark Proctor
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
Mark Proctor37.4K views
2012 02-04 fosdem 2012 - guvnor and j bpm designer by marcolof
2012 02-04 fosdem 2012 - guvnor and j bpm designer 2012 02-04 fosdem 2012 - guvnor and j bpm designer
2012 02-04 fosdem 2012 - guvnor and j bpm designer
marcolof1.8K views
JUDCon India 2012 Drools Fusion by Mark Proctor
JUDCon  India 2012 Drools FusionJUDCon  India 2012 Drools Fusion
JUDCon India 2012 Drools Fusion
Mark Proctor2.2K views
Drools and jBPM 6 Overview by Mark Proctor
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
Mark Proctor20.1K views

Similar to JUDCon India 2012 Drools Expert

Finding Gold wihin your business GMC Conference Session by
Finding Gold wihin your business GMC Conference SessionFinding Gold wihin your business GMC Conference Session
Finding Gold wihin your business GMC Conference SessionTony Vidler, CFP, CLU, ChFC
353 views16 slides
Webmaster Report. by
Webmaster Report.Webmaster Report.
Webmaster Report.webhostingguy
413 views21 slides
Refactor your specs! Øredev 2013 by
Refactor your specs! Øredev 2013Refactor your specs! Øredev 2013
Refactor your specs! Øredev 2013Cyrille Martraire
1.9K views182 slides
Drooling for drools (JBoss webex) by
Drooling for drools (JBoss webex)Drooling for drools (JBoss webex)
Drooling for drools (JBoss webex)Geoffrey De Smet
1.8K views88 slides
Hibernate - Basic by
Hibernate - BasicHibernate - Basic
Hibernate - BasicMohneesh Singh
582 views37 slides
Open Esb 20081104 V2 by
Open Esb 20081104 V2Open Esb 20081104 V2
Open Esb 20081104 V2Eduardo Pelegri-Llopart
819 views41 slides

Similar to JUDCon India 2012 Drools Expert(20)

Drooling for drools (JBoss webex) by Geoffrey De Smet
Drooling for drools (JBoss webex)Drooling for drools (JBoss webex)
Drooling for drools (JBoss webex)
Geoffrey De Smet1.8K views
eLearning 2.0 - ISPI Los Angeles by ★ Tony Karrer
eLearning 2.0 - ISPI Los AngeleseLearning 2.0 - ISPI Los Angeles
eLearning 2.0 - ISPI Los Angeles
★ Tony Karrer765 views
Architecting Android Apps: Marko Gargenta by jaxconf
Architecting Android Apps: Marko GargentaArchitecting Android Apps: Marko Gargenta
Architecting Android Apps: Marko Gargenta
jaxconf333 views
Web enabling your survey business by Rudy Stricklan
Web enabling your survey businessWeb enabling your survey business
Web enabling your survey business
Rudy Stricklan257 views
Drools Cylande Chtijug 2010 by Nicolas Heron
Drools Cylande Chtijug 2010Drools Cylande Chtijug 2010
Drools Cylande Chtijug 2010
Nicolas Heron614 views
Dr Strangler and Mr Hype - Strangler pattern w praktyce by Michał Kurzeja
Dr Strangler and Mr Hype - Strangler pattern w praktyceDr Strangler and Mr Hype - Strangler pattern w praktyce
Dr Strangler and Mr Hype - Strangler pattern w praktyce
Michał Kurzeja605 views
Work_SheetEnter the appropriate amount or item in the shaded cells.docx by ambersalomon88660
Work_SheetEnter the appropriate amount or item in the shaded cells.docxWork_SheetEnter the appropriate amount or item in the shaded cells.docx
Work_SheetEnter the appropriate amount or item in the shaded cells.docx
Developing e commerce-apps_oracle_and_java by Pankaj Jagadale
Developing e commerce-apps_oracle_and_javaDeveloping e commerce-apps_oracle_and_java
Developing e commerce-apps_oracle_and_java
Pankaj Jagadale415 views
PyLadies Talk: Learn to love the command line! by Blanca Mancilla
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!
Blanca Mancilla424 views
The Nintendo Wii Presentation For Canada Professionals 2 by Ben Herz
The Nintendo Wii Presentation For Canada Professionals 2The Nintendo Wii Presentation For Canada Professionals 2
The Nintendo Wii Presentation For Canada Professionals 2
Ben Herz561 views
10 Billion a Day, 100 Milliseconds Per: Monitoring Real-Time Bidding at AdRoll by Brian Troutwine
10 Billion a Day, 100 Milliseconds Per: Monitoring Real-Time Bidding at AdRoll10 Billion a Day, 100 Milliseconds Per: Monitoring Real-Time Bidding at AdRoll
10 Billion a Day, 100 Milliseconds Per: Monitoring Real-Time Bidding at AdRoll
Brian Troutwine8.8K views
Strangler Pattern in practice @PHPers Day 2019 by Michał Kurzeja
Strangler Pattern in practice @PHPers Day 2019Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Michał Kurzeja208 views
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl... by Daniel Cukier
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...
Eficiency and Low Cost: Pro Tips for you to save 50% of your money with Googl...
Daniel Cukier585 views

More from Mark Proctor

Rule Modularity and Execution Control by
Rule Modularity and Execution ControlRule Modularity and Execution Control
Rule Modularity and Execution ControlMark Proctor
263 views38 slides
Drools, jBPM OptaPlanner presentation by
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationMark Proctor
338 views69 slides
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin... by
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Mark Proctor
806 views32 slides
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video) by
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Mark Proctor
1.4K views90 slides
Drools Happenings 7.0 - Devnation 2016 by
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Mark Proctor
2.1K views82 slides
RuleML2015 : Hybrid Relational and Graph Reasoning by
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning Mark Proctor
1.7K views49 slides

More from Mark Proctor(20)

Rule Modularity and Execution Control by Mark Proctor
Rule Modularity and Execution ControlRule Modularity and Execution Control
Rule Modularity and Execution Control
Mark Proctor263 views
Drools, jBPM OptaPlanner presentation by Mark Proctor
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
Mark Proctor338 views
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin... by Mark Proctor
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Mark Proctor806 views
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video) by Mark Proctor
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Mark Proctor1.4K views
Drools Happenings 7.0 - Devnation 2016 by Mark Proctor
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016
Mark Proctor2.1K views
RuleML2015 : Hybrid Relational and Graph Reasoning by Mark Proctor
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning
Mark Proctor1.7K views
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps by Mark Proctor
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsRed Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Mark Proctor2.3K views
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology by Mark Proctor
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Mark Proctor3.8K views
UberFire Quick Intro and Overview (early beta Aug 2013) by Mark Proctor
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)
Mark Proctor2.8K views
Property Reactive RuleML 2013 by Mark Proctor
Property Reactive RuleML 2013Property Reactive RuleML 2013
Property Reactive RuleML 2013
Mark Proctor2.3K views
Reactive Transitive Closures with Drools (Backward Chaining) by Mark Proctor
Reactive Transitive Closures with Drools (Backward Chaining)Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)
Mark Proctor3.3K views
Drools 6.0 (JudCon 2013) by Mark Proctor
Drools 6.0 (JudCon 2013)Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)
Mark Proctor4.9K views
Drools 6.0 (CamelOne 2013) by Mark Proctor
Drools 6.0 (CamelOne 2013)Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)
Mark Proctor1.4K views
UberFire Quick Intro and Overview (early beta Jul 2013) by Mark Proctor
UberFire Quick Intro and Overview (early beta Jul 2013)UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)
Mark Proctor2.6K views
UberFire (JudCon 2013) by Mark Proctor
UberFire (JudCon 2013)UberFire (JudCon 2013)
UberFire (JudCon 2013)
Mark Proctor1.6K views
Drools 6.0 (Red Hat Summit 2013) by Mark Proctor
Drools 6.0 (Red Hat Summit 2013)Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)
Mark Proctor1.7K views
Games development with the Drools rule engine by Mark Proctor
Games development with the Drools rule engineGames development with the Drools rule engine
Games development with the Drools rule engine
Mark Proctor2.1K views
Drools & jBPM future roadmap talk by Mark Proctor
Drools & jBPM future roadmap talkDrools & jBPM future roadmap talk
Drools & jBPM future roadmap talk
Mark Proctor2.3K views
Drools @ IntelliFest 2012 by Mark Proctor
Drools @ IntelliFest 2012Drools @ IntelliFest 2012
Drools @ IntelliFest 2012
Mark Proctor2K views
Drools & jBPM Info Sheet by Mark Proctor
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
Mark Proctor5.9K views

Recently uploaded

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
263 views23 slides
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueShapeBlue
222 views7 slides
Generative AI: Shifting the AI Landscape by
Generative AI: Shifting the AI LandscapeGenerative AI: Shifting the AI Landscape
Generative AI: Shifting the AI LandscapeDeakin University
53 views55 slides
Kyo - Functional Scala 2023.pdf by
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
457 views92 slides
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...ShapeBlue
139 views29 slides
The Role of Patterns in the Era of Large Language Models by
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language ModelsYunyao Li
85 views65 slides

Recently uploaded(20)

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue263 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue222 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue139 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li85 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue106 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue194 views
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue123 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue198 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE79 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays56 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue132 views
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue126 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue159 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue184 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash158 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue206 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue203 views

JUDCon India 2012 Drools Expert

  • 1. 1 Mark Proctor Project Lead The SkyNet funding bill is passed. The system goes online on August 4th, 1997. Human decisions are removed from strategic defense. SkyNet begins to learn at a geometric rate. It becomes self-aware at 2:14am Eastern time, August 29th In a panic, they try to pull the plug. And, Skynet fights back
  • 4. 4 Wumpus World C e ll H e ro Wu m p u s P itt G old int row int row int row int row int row Int col Int col Int col Int col Int col
  • 7. 7 Wumpus World d e m ons tration
  • 9. 9 S ample Indus tries and Us ers Inve s tm e nt Mille nniu m Inve s tm e nt G rou p (M IG ) Logis tics Fed ex Airline S ab re M ortgage F ranklin Am e rican H e alth care OSDE
  • 10. 10 B oot C amps S an F rancis co 2009 (40+ atte nd e e s ) S p ons ore d b y Th ird P illar S u n, F AM C , O S D E , Kas e ya, F e d e x, TU G rou p , Inte rm ou ntain H e alth care , G ap , S ony P ictu re s , Lockh e e d Martin, Kais e r, H P , We lls F argo, U S N avy R e s e arch , F O LIO fn, Boe ing ..... S an D ie go 201 0 (80+ atte nd e s s ) S p ons ore d b y U S N avy 5 d ay e ve nt, with 2 d ays focu s on th e h e alth care ind u s try O S D E , AT&T, S AIC , U S N avy R e s e arch , Kais e r, C linica, Inte rm ou ntain H e alth care , G E H e alth care , VA, Boe ing, N ationwid e ....
  • 11. 11 Integrated S ys tems Rules Rules Workflows Workflows Event Processes Semantic Ontologies Semantic Event Ontologies Processes
  • 12. 12 generic Rules and proces s es ? Decision Services SCOPE Process specific Rules tightly coupled COUPLING loosely coupled
  • 13. 13 Integrated S ys tems Drools JBPM5 Drools Drools Expert (Drools Flow) Fusion Guvnor Drools Drools Drools Drools Planner Grid Semantics Chance Business Logic integration System
  • 14. 14 Declarative Programming P rod u ction R u le S ys te m s P R D (forward ch aining) R e active wh e n Alarm ( s tatu s = = “ale rt” ) th e n s e nd ( “warning” ) Logic P rogram m ing LP (b ackward ch aining) Q u e ry d e s ce nd ant( “m ary”, “j ”) ane F u nctional P rogram m ing F P Map ,F old , F ilte r avg([1 2, 1 6, 4, 6]) R e tu rns s ingle valu e 9.5 rou nd ([1 0.3, 4.7, 7.8] ) R e tu rns Lis t [1 0, 5, 8] D e s crip tion Logic P e rs on H as N am e and
  • 15. 15 C las s es C a s h f lo w A cco u n t D a te d a te lo n g a c c o u n t N o d o u b le a m o u n t d o u b le b a la n c e in t t y p e lo n g a c c o u n t N o A c c o u n t in g P e r io d D a te s ta r t D a te e n d
  • 16. 16 C redit C as hflow Rule select * from Account acc, Cashflow cf, AccountPeriod ap where acc.accountNo == cf.accountNo and cf.type == CREDIT cf.date >= ap.start and cf.date <= ap.end trigger : acc.balance += cf.amount rule “increase balance for AccountPeriod Credits” when ap : AccountPeriod() acc : Account( $accountNo : accountNo ) CashFlow( type == CREDIT, accountNo == $accountNo, date >= ap.start && <= ap.end, $ammount : ammount ) then acc.balance += $amount; end
  • 17. 17 Rules as a “ view” CashFlow AccountingPeriod date amount type accountNo start end 12-Jan-07 100 CREDIT 1 01-Jan-07 31-Mar-07 2-Feb-07 200 DEBIT 1 18-May-07 50 CREDIT 1 Account 9-Mar-07 75 CREDIT 1 accountNo balance 1 0 rule “increase balance for AccountPeriod rule “decrease balance for AccountPeriod Credits” Debits” when when ap : AccountPeriod() ap : AccountPeriod() acc : Account( $accountNo : accountNo ) acc : Account( $accountNo : accountNo ) CashFlow( type == CREDIT, CashFlow( type == DEBIT, accountNo == $accountNo, accountNo == $accountNo, date >= ap.start && <= ap.end, date >= ap.start && <= ap.end, $ammount : ammount ) $ammount : ammount ) then then acc.balance += $amount; acc.balance -= $amount; end CashFlow end CashFlow date amount type date amount type 12-Jan-07 100 CREDIT 2-Feb-07 200 DEBIT 9-Mar-07 75 CREDIT Account accountNo balance 1 -25
  • 18. 18 Definitions p u b lic clas s Ap p licant { p rivate S tring nam e ; p rivate int age ; p rivate b oole an valid ; / ge tte r and s e tte r m e th od s h e re / } rule "Is of valid age" when $a : Applicant( age < 18 ) then modify( $a ) { valid = false }; ends
  • 19. 19 B uilding Knowle d ge Bu ild e r kb u ild e r = Knowle d ge Bu ild e rF actory.ne wK nowle d ge Bu ild e r(); kb u ild e r.ad d ( R e s ou rce F actory .ne wC las s P ath R e s ou rce ( "lice ns e Ap p lication.d rl", ge tC las s () ), R e s ou rce Typ e .D R L ); if ( kb u ild e r.h as E rrors () ) { S ys te m .e rr.p rintln( kb u ild e r.ge tE rrors ().toS tring() ); } kb as e .ad d K nowle d ge P ackage s ( kb u ild e r.ge tKnowle d ge P ackage s () );
  • 20. 20 S pring C onfiguration
  • 21. 21 E xecuting rule "Is of valid age" when $a : Applicant( age < 18 ) then modify( $a ) { valid = false }; ends S tate le s s K nowle d ge S e s s ion ks e s s ion = kb as e .ne wS tate le s s Knowle d ge S e s s ion(); Ap p licant ap p licant = ne w Ap p licant( "M r Joh n S m ith ", 1 6 ); as s e rtTru e ( ap p licant.is Valid () ); ks e s s ion.e xe cu te ( ap p licant ); as s e rtF als e ( ap p licant.is Valid () );
  • 22. 22 Definitions p u b lic clas s R oom { p rivate S tring nam e / ge tte r and s e tte r m e th od s h e re / } p u b lic clas s S p rinkle r { p rivate R oom room ; p rivate b oole an on; / ge tte r and s e tte r m e th od s h e re / } p u b lic clas s F ire { p rivate R oom room ; / ge tte r and s e tte r m e th od s h e re / } p u b lic clas s Alarm {
  • 23. 23 Definitions ru le "Wh e n th e re is a fire tu rn on th e s p rinkle r" wh e n F ire ($room : room ) $s p rinkle r : S p rinkle r( room = = $room , on = = fals e ) th e n m od ify( $s p rinkle r ) { on = tru e }; p rintln( "Tu rn on th e s p rinkle r for room " + $room .nam e ); e nd ru le "Wh e n th e fire is gone tu rn off th e s p rinkle r" wh e n $room : R oom ( ) $s p rinkle r : S p rinkle r( room = = $room , on = = tru e ) not F ire ( room = = $room ) th e n m od ify( $s p rinkle r ) { on = fals e }; p rintln( "Tu rn off th e s p rinkle r for room " + $room .nam e );
  • 24. 24 Definitions ru le "R ais e th e alarm wh e n we h ave one or m ore fire s " wh e n e xis ts F ire () th e n ins e rt( ne w Alarm () ); p rintln( "R ais e th e alarm " ); e nd ru le "C ance l th e alarm wh e n all th e fire s h ave gone " wh e n not F ire () $alarm : Alarm () th e n re tract( $alarm ); p rintln( "C ance l th e alarm " ); e nd
  • 25. 25 Definitions ru le "S tatu s ou tp u t wh e n th ings are ok" wh e n not Alarm () not S p rinkle r( on = = tru e ) th e n p rintln( "E ve ryth ing is ok" ); e nd
  • 26. 26 E xecuting S tring[] nam e s = ne w S tring[]{"kitch e n", "b e d room ", "office ", "livingroom "}; M ap < S tring,R oom > nam e 2room = ne w H as h M ap < S tring,R oom > (); for( S tring nam e : nam e s ){ R oom room = ne w R oom ( nam e ); nam e 2room .p u t( nam e , room ); ks e s s ion.ins e rt( room ); S p rinkle r s p rinkle r = ne w S p rinkle r( room ); ks e s s ion.ins e rt( s p rinkle r ); } ks e s s ion.fire AllR u le s () > E ve ryth ing is ok
  • 27. 27 E xecuting F ire kitch e nF ire = ne w F ire ( nam e 2room .ge t( "kitch e n" ) ); F ire office F ire = ne w F ire ( nam e 2room .ge t( "office " ) ); F actH and le kitch e nF ire H and le = ks e s s ion.ins e rt( kitch e nF ire ); F actH and le office F ire H and le = ks e s s ion.ins e rt( office F ire ); ks e s s ion.fire AllR u le s (); > R ais e th e alarm > Tu rn on th e s p rinkle r for room kitch e n > Tu rn on th e s p rinkle r for room office
  • 28. 28 E xecuting ks e s s ion.re tract( kitch e nF ire H and le ); ks e s s ion.re tract( office F ire H and le ); ks e s s ion.fire AllR u le s () > Tu rn off th e s p rinkle r for room office > Tu rn off th e s p rinkle r for room kitch e n > C ance l th e alarm > E ve ryth ing is ok ru le "S tatu s ou tp u t wh e n th ings are ok" wh e n not Alarm () not S p rinkle r( on = = tru e ) th e n p rintln( "E ve ryth ing is ok" );
  • 29. 29 C onditional E lements not Bus( color = “red” ) exists Bus( color = “red” ) forall ( $bus : Bus( color == “red” ) ) forall ( $bus : Bus( floors == 2 ) Bus( this == $bus, color == “red” ) )
  • 30. 30 A ccumulate C E ru le "accu m u late " wh e n $s u m : N u m b e r( intValu e > 1 00 ) from accu m u late ( Bu s ( color = = "re d ", $t : takings ) s u m ( $t ) ) th e n p rint "s u m is “ + $s u m ; e nd
  • 32. 32 Decis ion Table rule "Pricing bracket_10" when Driver(age >= 18, age <= 24, locationRiskProfile == "LOW", priorClaims == "1") policy: Policy(type == "COMPREHENSIVE") then policy.setBasePrice(450);
  • 33. 33 Types Types Layou t H orizontal Ve rtical Lim ite d e ntry E xte nd e d e ntry C ate goris ation E xp and e d form , contracte d form M u lti-h it, all h its M u lti-h it, firs t h it S ingle h it
  • 34. 34 Layouts Horizontal
  • 35. 35 Layouts Vertical
  • 36. 36 Layouts Limited entry
  • 37. 37 Layouts E xtended entry
  • 38. 38 C ategoris ation E xpanded form S ingle colu m n for e ve ry cond ition com b ination Th e nu m b e r of colu m ns s h ou ld e qu al th e p rod u ct of th e nu m b e r of s tate s for e ve ry cond ition. e .g. 2 cond itions , one with 3 s tate s th e oth e r 4 (s e e ab ove ): 3 * 4 = 1 2 com b inations e .g. 2 cond itions e ach with 3 s tate s and 1 cond ition with 4 s tate s give s : 3 * 3 * 4 = 36 com b inations
  • 39. 39 C ategoris ation E xpanded form (continued)
  • 40. 40 C ategoris ation C ontracted form C ontraction is th e firs t op tim is ation. R e d u ce s th e nu m b e r of cond ition colu m ns . R e m ove s im p os s ib le com b inations If th e s am e actions e xis t for ru le s cove ring all cond ition s tate s for a give n cond ition th e y can b e com b ine d and th e cond ition s tate b e com e s irre le vant.
  • 41. 41 C ategoris ation C ontracted form – s tage 1 R u le s 2 and 3 are im p os s ib le cond itions
  • 42. 42 C ategoris ation C ontracted form – s tage 2 M e rge ad j nt colu m n grou p s with id e ntical action p arts ace
  • 43. 43 C ategoris ation Multi-hit, all hits To ge t com p le te re s u lt all ru le s m atch ing ne e d to h ave th e ir actions e xe cu te d . C ond ition colu m ns are not m u tu ally e xclu s ive If th e C ond ition colu m ns are not e xclu s ive , s om e com b ination of cond itions are p re s e nt in m ore th an one colu m n, wh ich m ay le ad to am b igu ity or incons is te ncy.
  • 44. 44 C ategoris ation Multi-hit, all hits G ive n a 35 ye ar old with 1 5 ye ars s e rvice 1 . R u le 1 m atch e s , giving 22 d ays 2. R u le 5 m atch e s , giving an ad d itional 3 d ays 3. A total of 25 d ays is as s igne d
  • 45. 45 C ategoris ation Multi-hit, firs t hit To ge t com p le te re s u lt th e firs t ru le (from le ft-to-righ t) m atch ing ne e d s to h ave its action e xe cu te d . C ond ition colu m ns are not m u tu ally e xclu s ive . If th e C ond ition colu m ns are not e xclu s ive , s om e com b ination of cond itions are p re s e nt in m ore th an one colu m n, wh ich m ay le ad to am b igu ity or incons is te ncy.
  • 46. 46 C ategoris ation Multi-hit, firs t hit G ive n a 35 ye ar old with 1 5 ye ars s e rvice 1 . R u le 4 m atch e s , giving 25 d ays 2. R u le 6 wou ld m atch b u t R u le 4 was th e firs t h it
  • 47. 47 C ategoris ation S ingle hit E ach p os s ib le com b ination of cond itions m atch e s e xactly one , and only one , ru le . C ond ition colu m ns are m u tu ally e xclu s ive As th e C ond ition colu m ns are e xclu s ive ; com b inations of cond itions cannot b e p re s e nt in m ore th an one colu m n wh ich e lim inate s am b igu ity and incons is te ncy. C las s ic form if S ingle -h it is "e xp and e d d e cis ion tab le "; b u t th is can b e op tim is e d or “contracte d ”.
  • 48. 48 C ategoris ation S ingle hit G ive n a 35 ye ar old with 1 5 ye ars s e rvice 1 . R u le 3 m atch e s , giving 25 d ays 2. N o oth e r ru le s m atch
  • 49. 49 Validation & Verification Redundancy - S ubs umption
  • 50. 50 Validation & Verification Deficiency P re m iu m is £500 if ap p licant age is le s s th an 30 P re m iu m is £300 if Ye ars With ou t C laim is gre ate r th an or e qu al to 1 0 ye ars . Ap p licant is 29, p re m iu m is £500 Ap p licant h as 1 2 ye ars with ou t claim , p re m iu m is £300 Ap p licant is 29 with 1 2 ye ars with ou t claim , p re m iu m is ?!?
  • 51. 51 Decis ion Tables in G uvnor Vid e o d e m ons tration
  • 56. 56 Decision Tables – Cell merging.. etc Cell Merging Cell Grouping Typed Columns Sorting by column Negate pattern Support for Ohterwise
  • 62. 62 TMS and Inference ru le "Is s u e C h ild Bu s P as s " Couples the logic wh e n $p : P e rs on( age < 1 6 ) th e n ins e rt(ne w C h ild Bu s P as s ( $p ) ); e nd ru le "Is s u e Ad u lt Bu s P as s " What happens when the Child stops being 16? wh e n $p : P e rs on( age > = 1 6 ) th e n ins e rt(ne w Ad u ltBu s P as s ( $p ) ); e nd
  • 63. 63 TMS and Inference Bad Monolith ic Le aky Brittle inte grity - m anu al m ainte nance
  • 64. 64 TMS and Inference A ru le “logically” ins e rts an ob j ct e Wh e n th e ru le is no longe r tru e , th e ob j ct is re tracte d . e wh e n de-couples the logic $p : P e rs on( age < 1 6 ) th e n logicalIns e rt( ne w Is C h ild ( $p ) ) e nd wh e n Maintains the truth by automatically retracting $p : P e rs on( age > = 1 6 ) th e n logicalIns e rt( ne w Is Ad u lt( $p ) ) e nd
  • 65. 65 TMS and Inference ru le "Is s u e C h ild Bu s P as s " wh e n $p : P e rs on( ) Is C h ild ( p e rs on = $p ) th e n logicalIns e rt(ne w C h ild Bu s P as s ( $p ) ); e nd The truth maintenance ru le "Is s u e Ad u lt Bu s P as s " cascades wh e n $p : P e rs on( age > = 1 6 ) Is Ad u lt( p e rs on = $p ) th e n logicalIns e rt(ne w Ad u ltBu s P as s ( $p ) ); e nd
  • 66. 66 TMS and Inference ru le "Is s u e C h ild Bu s P as s " wh e n $p : P e rs on( ) not( C h ild Bu s P as s ( p e rs on = = $p ) ) th e n re qu e s tC h ild Bu s P as s ( $p ); The truth maintenance cascades e nd
  • 67. 67 TMS and Inference G ood D e -cou p le knowle d ge re s p ons ib ilitie s E ncap s u late knowle d ge P rovid e s e m antic ab s tractions for th os e e ncap s u lation Inte grity rob u s tne s s – tru th m ainte nance
  • 68. 68 Ques tions ? D ave Bowm an: All righ t, H AL; I'll go in th rou gh th e e m e rge ncy airlock. H AL: With ou t you r s p ace h e lm e t, D ave , you 're going to find th at rath e r d ifficu lt. D ave Bowm an: H AL, I won't argu e with you anym ore ! O p e n th e d oors ! H AL: D ave , th is conve rs ation can s e rve no p u rp os e anym ore . G ood b ye . essor Falken. oshua. . The only winning move is not to play. How about a nice game of chess

Editor's Notes

  1. JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
  2. JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments