Drools5 Community Training
     DSL & Decision Tables
      Sponsored by Plugtree
Module 6: Drools Expert
 DSL & Decision Tables
   Drools5 Community Training
      version: 1.0-SNAPSHOT
     Release Date: 03/16/2011
Under The Creative Common License
Module 6: Drools Expert
  DSL & Decision Tables
 Drools5 Community Training Course
           by Mauricio "Salaboy"
     Salatino and Esteban Aliverti is
 licensed under a Creative Commons
    Attribution 3.0 Unported License.
Based on a work at salaboy.wordpress.
                   com.
 Permissions beyond the scope of this
    license may be available at http:
        //salaboy.wordpress.com/.
Agenda

● Other ways to express rules
   ○ Domain Specific Languages
   ○ Decision Tables
Other ways to express rules 

● DSL -> Express Rules in natural Language
● SpreadSheets -> Express rules as decision tables
Domain Specific Languages

Example:

DRL:
Song(genre == "Jazz")

DSL:
 [Condition]There is a Jazz Song = Song(genre == "Jazz")
Domain Specific Languages

● Focused on Subject Matter Experts
● Natural Language
● Can be used in guided editor
● It's just mapping your business language in DRL
DSL Example
DSL files have two main sections (condition / consequence) with the
following semantics:
   [condition or consequence] natural language expression = drools mapping/execution expression

DSL semantics allow binding of variables in the natural language
expression to the drools expression:
                When the user is called {userName} = User(name== "{userName}")

DSL resources must be added to kbuilder previous to DSLR
DSL Full Example
DSL File




           DSLR File
Decision Tables

● More business-user friendly
● Useful in situations when we have a lot of similar rules
● Drools supports XLS or CSV files
● Behind-the-scenes Drools transforms Decision Tables to
  vanilla DRL
Decision Tables Example
Hands on Labs

Projects:
 ● 04 :: Drools Expert Spreadsheet Example
 ● 05 :: Drools Expert DSL Simple Example
 
              
Questions?
Enjoy! Questions and Feedback are
always appreciated!
 
                     
    Contact us at
www.plugtree.com

Drools5 Community Training Module 6 Drools DSL & Spreadsheets

  • 1.
        Drools5 Community Training DSL & Decision Tables Sponsored by Plugtree
  • 2.
    Module 6: DroolsExpert DSL & Decision Tables Drools5 Community Training version: 1.0-SNAPSHOT Release Date: 03/16/2011 Under The Creative Common License
  • 3.
    Module 6: DroolsExpert DSL & Decision Tables Drools5 Community Training Course by Mauricio "Salaboy" Salatino and Esteban Aliverti is licensed under a Creative Commons Attribution 3.0 Unported License. Based on a work at salaboy.wordpress. com. Permissions beyond the scope of this license may be available at http: //salaboy.wordpress.com/.
  • 4.
    Agenda ● Other waysto express rules ○ Domain Specific Languages ○ Decision Tables
  • 5.
    Other ways toexpress rules  ● DSL -> Express Rules in natural Language ● SpreadSheets -> Express rules as decision tables
  • 6.
    Domain Specific Languages Example: DRL: Song(genre== "Jazz") DSL: [Condition]There is a Jazz Song = Song(genre == "Jazz")
  • 7.
    Domain Specific Languages ●Focused on Subject Matter Experts ● Natural Language ● Can be used in guided editor ● It's just mapping your business language in DRL
  • 8.
    DSL Example DSL fileshave two main sections (condition / consequence) with the following semantics: [condition or consequence] natural language expression = drools mapping/execution expression DSL semantics allow binding of variables in the natural language expression to the drools expression: When the user is called {userName} = User(name== "{userName}") DSL resources must be added to kbuilder previous to DSLR
  • 9.
    DSL Full Example DSLFile DSLR File
  • 10.
    Decision Tables ● Morebusiness-user friendly ● Useful in situations when we have a lot of similar rules ● Drools supports XLS or CSV files ● Behind-the-scenes Drools transforms Decision Tables to vanilla DRL
  • 11.
  • 12.
    Hands on Labs Projects: ● 04 :: Drools Expert Spreadsheet Example ● 05 :: Drools Expert DSL Simple Example
  • 13.
        Questions?
  • 14.
    Enjoy! Questions andFeedback are always appreciated!
  • 15.
        Contact us at www.plugtree.com