Drools5 Community Training Module#1: Drools5 BLiP Introduction
Drools5 Community Training
Sponsored by Plugtree
Module 1: Drools BLiP
Theoretical Introduction
Drools5 Community Training
version: 1.0-SNAPSHOT
Release Date: 03/16/2011
Under The Creative Common License
Module 1: Drools BLiP
Theoretical Introduction
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/.
Artificial Intelligence (AI)
"The study and design of intelligent agents."
An intelligent agent is a system that perceives its environment
and takes actions which maximize its chances of success.
The ability of a machine to perform tasks that require human
intelligence.
Expert Systems
"An expert system is software that attempts to provide an
answer to a problem where normally one or more human
experts would be consulted."
In the begining was replace and now it's assist
Software that knows about a specific domain
It can solve/answer specific questions
Expert Systems
Common Uses of Expert Systems
+ Medicine
-> Diagnosis based on patient symptoms
+ Field Analysis
-> Evaluation of geographical regions (Petrol Prospecting)
+ Mortgages and Loans
-> Used for risk evaluation (scoring)
Inference Engines
"An inference engine is a computer program that tries to
derive answers from a knowledge base. It is the "brain" that
expert systems use to reason to formulate new conclusions for a
certain situation."
Inference Engines
An inference engine will be in charge of using the formalized
knowledge from our expert to answer questions for a specific
situation.
Production Systems
A production system (or production rule system) are
software that are composed of a set of rules about behavior.
These rules are a simple and basic representation of
knowledge.
A production system provides the mechanism to execute
actions (behavior) in order to achieve some goal for the system.
Chaining Strategies
Methods of Reasoning in Inference Engines
Backward Chaining:
goal-driven -> Prolog
Forward Chaining:
data-driven -> Drools
Chaining Strategies Example
Scenario:
Pet (name == "Fritz", behavior =="croaks")
Question: What is the color of my Pet?
Rules / Knowledge:
1) When Pet(behavior == "croaks") Then Pet.type = "Frog"
2) When Pet(behavior == "sings") Then Pet.type = "Canary"
3) When Pet(type == "Frog") Then Pet.color = "green"
4) When Pet(type == "Canary") Then Pet.color = "yellow"
Some characteristics
Output answers will contain the justification
These kinds of systems are created to support large amounts
of knowledge to solve complex situations
The knowledge can be:
Expressed by Domain Specific users
Reused
Iteratively improved
Maintained decoupled from your application code
Drools History
The project was born in '03
Mark Proctor in the project leader
Born as an Inference Engine
It started using the LEAPS algorithm for pattern matching
In Drools 3.x they implemented RETE algorithm
In Drools 4.x the RETE algorithm was tuned for high
performance
Drools 5 BLiP
Named as Business Logic integration Platform (BLiP)
Modules:
Drools Expert (leader Mark Proctor)
jBPM5 / Drools Flow (leader Kris Verlaenen)
Drools Fusion (leader Edson Tirelli)
Drools Guvnor (leader Toni Rikkola)
* There are other experimental modules (Planner, Chance, Grid
etc.) that will be not covered here.
Drools Expert
The core of Drools
Contains the inference engine
Uses the RETE algorithm for pattern matching
Provides us with a way to create a knowledge base
Provides us with a simple API to interact with the inference
engine
Business Rule Structure
rule "My Rule"
<attributes>
when <LHS>
Person(name == "John") <CEs>
then <RHS>
System.out.println("Hi John!");
<Actions>
end
jBPM5
Focused on BPM
Implements the main stages of the discipline:
Model/Design
Execute
Monitor
Pretty close to finish BPMN2 implementation
Uses the same APIs that we use in Drools Expert
Fully integrated with the inference engine
jBPM5
Common use cases
In every company Business Processes are used implicitly or
explicitly
In every business activity
In every non-business situation that defines a logical set of
activities that needs to be executed/performed
Drools Fusion
Focused in Complex Event Processing
Temporal reasoning
13 temporal operators (before, after, during, and so on)
Enables us to detect complex events (event correlation
patterns)
Drools Fusion
Common use cases:
Fraud Detection
Stock Trading
Hardware monitoring
Transport and Logistics
Everywhere we need to correlate or aggregate events
Drools Guvnor
Commonly tagged as a BRMS
Centralized Knowledge Repository (JCR)
Handles the Knowledge versioning and categorization
Now it includes more User Friendly features like:
Guided Rules Authoring
Test Cases Creation
Rule Constraints Meta-Model
Rule Validation and Verification
Business Process Modeling