Drools Documentation
Total Page:16
File Type:pdf, Size:1020Kb
Drools Documentation Version 6.1.0.Beta4 by The JBoss Drools team [http://www.jboss.org/drools/team.html] ........................................................................................................................................ xi I. Welcome ........................................................................................................................ 1 1. Introduction ......................................................................................................... 3 1.1. Introduction ................................................................................................ 3 1.2. Getting Involved .......................................................................................... 3 1.2.1. Sign up to jboss.org ......................................................................... 4 1.2.2. Sign the Contributor Agreement ........................................................ 4 1.2.3. Submitting issues via JIRA ............................................................... 5 1.2.4. Fork GitHub ..................................................................................... 6 1.2.5. Writing Tests ................................................................................... 6 1.2.6. Commit with Correct Conventions ..................................................... 8 1.2.7. Submit Pull Requests ....................................................................... 9 1.3. Installation and Setup (Core and IDE) ........................................................ 11 1.3.1. Installing and using ........................................................................ 11 1.3.2. Building from source ....................................................................... 21 1.3.3. Eclipse ........................................................................................... 22 2. Release Notes .................................................................................................... 29 2.1. New and Noteworthy in KIE API 6.0.0 ........................................................ 29 2.1.1. New KIE name ............................................................................... 29 2.1.2. Maven aligned projects and modules and Maven Deployment ............ 29 2.1.3. Configuration and convention based projects ................................... 30 2.1.4. KieBase Inclusion ........................................................................... 30 2.1.5. KieModules, KieContainer and KIE-CI .............................................. 31 2.1.6. KieScanner .................................................................................... 31 2.1.7. Hierarchical ClassLoader ................................................................ 32 2.1.8. Legacy API Adapter ....................................................................... 32 2.1.9. KIE Documentation ........................................................................ 32 2.2. What is New and Noteworthy in Drools 6.0.0 .............................................. 33 2.2.1. PHREAK - Lazy rule matching algorithm .......................................... 33 2.2.2. Automatically firing timed rule in passive mode ................................. 33 2.2.3. Expression Timers .......................................................................... 34 2.2.4. RuleFowGroup and AgendaGroups are merged ............................... 35 2.3. New and Noteworthy in KIE Workbench 6.0.0 ............................................. 35 2.4. New and Noteworthy in Integration 6.0.0 .................................................... 38 2.4.1. CDI ............................................................................................... 38 2.4.2. Spring ............................................................................................ 39 2.4.3. Aries Blueprints .............................................................................. 39 2.4.4. OSGi Ready .................................................................................. 39 3. Compatibility matrix ........................................................................................... 41 II. KIE ............................................................................................................................. 43 4. KIE ..................................................................................................................... 45 4.1. Overview .................................................................................................. 45 4.1.1. Anatomy of Projects ....................................................................... 45 4.1.2. Lifecycles ....................................................................................... 46 iii Drools Documentation 4.2. Build, Deploy, Utilize and Run ................................................................... 47 4.2.1. Introduction .................................................................................... 47 4.2.2. Building ......................................................................................... 50 4.2.3. Deploying ...................................................................................... 67 4.2.4. Running ......................................................................................... 73 4.2.5. Installation and Deployment Cheat Sheets ....................................... 88 4.2.6. Build, Deploy and Utilize Examples ................................................. 89 4.3. Security .................................................................................................. 101 4.3.1. Security Manager ......................................................................... 101 III. Drools Runtime and Language .................................................................................. 105 5. Hybrid Reasoning ............................................................................................ 107 5.1. Artificial Intelligence ................................................................................. 107 5.1.1. A Little History ............................................................................. 107 5.1.2. Knowledge Representation and Reasoning .................................... 108 5.1.3. Rule Engines and Production Rule Systems (PRS) ......................... 109 5.1.4. Hybrid Reasoning Systems (HRS) ................................................. 111 5.1.5. Expert Systems ............................................................................ 114 5.1.6. Recommended Reading ................................................................ 115 5.2. Rete Algorithm ........................................................................................ 118 5.3. ReteOO Algorithm ................................................................................... 125 5.4. PHREAK Algorithm ................................................................................. 126 6. User Guide ....................................................................................................... 135 6.1. The Basics ............................................................................................. 135 6.1.1. Stateless Knowledge Session ........................................................ 135 6.1.2. Stateful Knowledge Session .......................................................... 138 6.1.3. Methods versus Rules .................................................................. 143 6.1.4. Cross Products ............................................................................ 144 6.2. Execution Control .................................................................................... 145 6.2.1. Agenda ........................................................................................ 145 6.2.2. Rule Matches and Conflict Sets. .................................................... 146 6.2.3. Declarative Agenda ...................................................................... 153 6.3. Inference ................................................................................................ 155 6.3.1. Bus Pass Example ....................................................................... 155 6.4. Truth Maintenance with Logical Objects .................................................... 158 6.4.1. Overview ...................................................................................... 158 6.5. Decision Tables in Spreadsheets ............................................................. 162 6.5.1. When to Use Decision Tables ....................................................... 163 6.5.2. Overview ...................................................................................... 163 6.5.3. How Decision Tables Work ........................................................... 165 6.5.4. Spreadsheet Syntax ..................................................................... 169 6.5.5. Creating and integrating Spreadsheet based Decision Tables .......... 179 6.5.6. Managing Business Rules in Decision Tables ................................. 179 6.5.7. Rule Templates ............................................................................ 180 6.6. Logging .................................................................................................. 183 iv 7. Rule Language Reference ................................................................................ 185 7.1. Overview ................................................................................................ 185 7.1.1. A rule file