Drools5 Community Training
      Sponsored by Plugtree
Module 5: Drools BLiP
Architectural Overview
   Drools5 Community Training
      version: 1.0-SNAPSHOT
     Release Date: 03/16/2011
Under The Creative Common License
Module 5: Drools BLiP
 Architectural Overview
 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


● Drools Overview
● Core Components
   ○ Drools Main Modules
● Possible Architectures
● Demos
Drools Overview


● It was born as an Inference Engine
● More functionality was added on top of it
● A Platform was created to create applications
● The declarative approach provided helps us to share the
  knowledge with non technical roles
● A Knowledge Driven Development Approach was proposed
  to build applications on top of the platform
The Drools Project


● Open Source
● Apache Licensed
● Free to use
● Innovative approach
● Community Support
Drools Overview

● Drools Expert (Rule Engine)

● Drools Flow == jBPM5

● Drools Fusion

● Drools Guvnor
Drools Overview
Drools Expert


● Drools Expert
   ○ Contains the Inference Engine
   ○ Pure Java
   ○ Provides a language to write declarative rules
   ○ Provides the APIs to interact with it
   ○ Environmental Agnostic (JSE, JEE, Spring)
   ○ Lightweight
jBPM5 == Drools Flow


● jBPM5 == Drools Flow
    ○ Provides Business Process Management features
    ○ Runs on top of the Rule Engine
    ○ Enable us with dynamic and declarative capabilities to
      create smarter processes
Drools Fusion


● Drools Fusion
   ○ Enables the notion of time to the Rule Engine
   ○ Let us define our meaningful events in our domain
   ○ Defines 13 temporal operators to correlate and aggregate
     stream of events
   ○ It operates in near real-time allowing us to react on
     immediately to an ongoing situation
   ○ Takes advantage of the inference capabilities of the Rule
     Engine
Drools Guvnor


● Drools Guvnor
   ○ Its a centralized Knowledge Repository
   ○ Allow us to store and manage our business knowledge
   ○ Tag, Categorize and Version our knowledge assets
   ○ Provides some UIs to manage our knowledge assets
Drools Artifacts


● Drools Artifacts
   ○ Lightweight Java Library
   ○ Gives us the flexibility to use it no matter the
     environment
   ○ Allows us to define the best architecture for each specific
     situation
Drools Architectural Goals


● Drools was designed and conceived for:
   ○ Express business knowledge declaratively
   ○ Integrate different solutions/applications using a
     declarative approach
   ○ To provide an unified and knowledge driven
     development approach
   ○ To provide a link of communication between business
     people and technical people
   ○ To be non-intrusive
Alternative Architectures


● Drools Alternative Architectures
   ○ Embedded
   ○ As a Service
Embedded


● Drools Embedded Architecture
Embedded -> Centralized Knowledge


● Drools Embedded Architecture, centralized Knowledge
As A Service (Centralized)


● Drools As A Service (Centralized) Architecture
As A Service (Centralized)


● Drools As A Service (Centralized) Architecture
Stateful vs Stateless Services


● Stateful vs Stateless Services
   ○ You need to define the nature of your problems
   ○ Stateless situations are easy to manage
       ■ Replicate services in different nodes becomes trivial
       ■ Caches for data access can be used
   ○ Stateful situations give us more rich set of features
       ■ Require session data replication in different nodes
       ■ We need to analyze what happen if a session breaks
         and how it affects to the overall application
Stateful Knowledge Services


● Stateful Knowledge Services
   ○ Enable us to have long running execution
   ○ We will be able to maintain contextual information to
     work on
   ○ The inference process will much more richer
   ○ Business Processes can run without any problem
   ○ Events require a stateful environment to work
   ○ We need to use some kind of persistence mechanism if
     we want to have fault tolerance
Stateful Knowledge Services with Events


● Stateful Knowledge Services with Events
Demos


● Demos
   ○ Emergency Service Application
   ○ Dynamic Content Selection PoC
Emergency Service Application


● Emergency Service Application
   ○ Simulate a real world situation
   ○ Demonstrate the advantages of using business processes,
     business rules and event processing all together
   ○ Download and Play:
      ■ https://github.com/Salaboy/emergency-service-
        drools-app
Emergency Service Application
Dynamic Content Selection


● Dynamic Content Selection Application
   ○ Proof of Concept to show Drools features
   ○ Demonstrate the information that we can capture from
     the user interaction with different visual components
   ○ Demonstrate how we can create a simple to enable non
     technical roles to define/validate what the application
     needs to do in different situations
   ○ Demonstrate how we can react on different identified
     situations
   ○ Download and Test:
       ■ https://github.com/Salaboy/smart-content-selection
Dynamic Content Selection
Dynamic Content Selection


● Dynamic Content Selection Application
   ○ Drools will keep track of the status of our visual
     components for each use
   ○ Drools will be listening events that will be generated
     during the user interaction
   ○ Temporal rules will be defined to correlate the streams of
     events generated by one or multiple users
Dynamic Content Selection



● Events Correlation for a Single User
   ○ Behavioral Event Stream
      ■ Navigation Events
      ■ Browsing Events
      ■ Component Interaction Events
   ○ Shopping Cart Event Stream
Dynamic Content Selection



● Events Correlation for a Multiple Users
   ○ Trends Analysis
      ■ More than X users selecting interacting with a
        Product in the last 2 minutes
      ■ More than X users with similar products in their
        shopping carts
      ■ More than X searches for a specific topic
Dynamic Content Selection


● Behavioral Event Stream
   ○ Page Navigation Events
      ■ Links Clicks, Search Events
   ○ Browsing Information Events
      ■ Analyzing a component information (Focus,
        Scrolling, Resizing, etc)
      ■ Multi Focus Analysis (selection patterns)
   ○ Component Interaction Events
      ■ Changing the component state (submitting a form,
        select a value that changes the state of the
        component)
Dynamic Content Selection


● Shopping Cart Event Stream
   ○ Add Product To Cart
   ○ Remove Product From Cart
   ○ Checkout Products
   ○ Empty Cart
Dynamic Content Selection


● Use Cases for Single User
   ○ Single Focus Interest Period
      ■ Offer Discount
   ○ Multi Focus / Pattern Selection
      ■ Related Product Suggestion
   ○ Abandoned Shopping Cart
      ■ Warning
   ○ Checkout Shopping Cart Quickly
      ■ Related Product Offer
Dynamic Content Selection


● Single Focus Interest Period
   ○ Offer Discount
Dynamic Content Selection


● Multi Focus / Pattern Selection
   ○ Related Product Suggestion
Dynamic Content Selection


● Abandoned Shopping Cart
   ○ Warning
Dynamic Content Selection


● Checkout Shopping Cart Quickly
   ○ 10% Discount Voucher for future shops
Related Links


● You can find more information, examples, tutorials and
  more in:
   ○ Salaboy Blog
      ■ http://salaboy.wordpress.com
   ○ Esteban Blog
      ■ http://ilesteban.wordpress.com
   ○ Plug Tree Blog
      ■ http://www.plugtree.com
 
              
Questions?
Enjoy! Questions and Feedback are
always appreciated!
 
                     
    Contact us at
www.plugtree.com

Drools5 Community Training Module 5 Drools BLIP Architectural Overview + Demos

  • 1.
        Drools5 Community Training Sponsored by Plugtree
  • 2.
    Module 5: DroolsBLiP Architectural Overview Drools5 Community Training version: 1.0-SNAPSHOT Release Date: 03/16/2011 Under The Creative Common License
  • 3.
    Module 5: DroolsBLiP Architectural Overview 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 ● Drools Overview ●Core Components ○ Drools Main Modules ● Possible Architectures ● Demos
  • 5.
    Drools Overview ● Itwas born as an Inference Engine ● More functionality was added on top of it ● A Platform was created to create applications ● The declarative approach provided helps us to share the knowledge with non technical roles ● A Knowledge Driven Development Approach was proposed to build applications on top of the platform
  • 6.
    The Drools Project ●Open Source ● Apache Licensed ● Free to use ● Innovative approach ● Community Support
  • 7.
    Drools Overview ● DroolsExpert (Rule Engine) ● Drools Flow == jBPM5 ● Drools Fusion ● Drools Guvnor
  • 8.
  • 9.
    Drools Expert ● DroolsExpert ○ Contains the Inference Engine ○ Pure Java ○ Provides a language to write declarative rules ○ Provides the APIs to interact with it ○ Environmental Agnostic (JSE, JEE, Spring) ○ Lightweight
  • 10.
    jBPM5 == DroolsFlow ● jBPM5 == Drools Flow ○ Provides Business Process Management features ○ Runs on top of the Rule Engine ○ Enable us with dynamic and declarative capabilities to create smarter processes
  • 11.
    Drools Fusion ● DroolsFusion ○ Enables the notion of time to the Rule Engine ○ Let us define our meaningful events in our domain ○ Defines 13 temporal operators to correlate and aggregate stream of events ○ It operates in near real-time allowing us to react on immediately to an ongoing situation ○ Takes advantage of the inference capabilities of the Rule Engine
  • 12.
    Drools Guvnor ● DroolsGuvnor ○ Its a centralized Knowledge Repository ○ Allow us to store and manage our business knowledge ○ Tag, Categorize and Version our knowledge assets ○ Provides some UIs to manage our knowledge assets
  • 13.
    Drools Artifacts ● DroolsArtifacts ○ Lightweight Java Library ○ Gives us the flexibility to use it no matter the environment ○ Allows us to define the best architecture for each specific situation
  • 14.
    Drools Architectural Goals ●Drools was designed and conceived for: ○ Express business knowledge declaratively ○ Integrate different solutions/applications using a declarative approach ○ To provide an unified and knowledge driven development approach ○ To provide a link of communication between business people and technical people ○ To be non-intrusive
  • 15.
    Alternative Architectures ● DroolsAlternative Architectures ○ Embedded ○ As a Service
  • 16.
  • 17.
    Embedded -> CentralizedKnowledge ● Drools Embedded Architecture, centralized Knowledge
  • 18.
    As A Service(Centralized) ● Drools As A Service (Centralized) Architecture
  • 19.
    As A Service(Centralized) ● Drools As A Service (Centralized) Architecture
  • 20.
    Stateful vs StatelessServices ● Stateful vs Stateless Services ○ You need to define the nature of your problems ○ Stateless situations are easy to manage ■ Replicate services in different nodes becomes trivial ■ Caches for data access can be used ○ Stateful situations give us more rich set of features ■ Require session data replication in different nodes ■ We need to analyze what happen if a session breaks and how it affects to the overall application
  • 21.
    Stateful Knowledge Services ●Stateful Knowledge Services ○ Enable us to have long running execution ○ We will be able to maintain contextual information to work on ○ The inference process will much more richer ○ Business Processes can run without any problem ○ Events require a stateful environment to work ○ We need to use some kind of persistence mechanism if we want to have fault tolerance
  • 22.
    Stateful Knowledge Serviceswith Events ● Stateful Knowledge Services with Events
  • 23.
    Demos ● Demos ○ Emergency Service Application ○ Dynamic Content Selection PoC
  • 24.
    Emergency Service Application ●Emergency Service Application ○ Simulate a real world situation ○ Demonstrate the advantages of using business processes, business rules and event processing all together ○ Download and Play: ■ https://github.com/Salaboy/emergency-service- drools-app
  • 25.
  • 26.
    Dynamic Content Selection ●Dynamic Content Selection Application ○ Proof of Concept to show Drools features ○ Demonstrate the information that we can capture from the user interaction with different visual components ○ Demonstrate how we can create a simple to enable non technical roles to define/validate what the application needs to do in different situations ○ Demonstrate how we can react on different identified situations ○ Download and Test: ■ https://github.com/Salaboy/smart-content-selection
  • 27.
  • 28.
    Dynamic Content Selection ●Dynamic Content Selection Application ○ Drools will keep track of the status of our visual components for each use ○ Drools will be listening events that will be generated during the user interaction ○ Temporal rules will be defined to correlate the streams of events generated by one or multiple users
  • 29.
    Dynamic Content Selection ●Events Correlation for a Single User ○ Behavioral Event Stream ■ Navigation Events ■ Browsing Events ■ Component Interaction Events ○ Shopping Cart Event Stream
  • 30.
    Dynamic Content Selection ●Events Correlation for a Multiple Users ○ Trends Analysis ■ More than X users selecting interacting with a Product in the last 2 minutes ■ More than X users with similar products in their shopping carts ■ More than X searches for a specific topic
  • 31.
    Dynamic Content Selection ●Behavioral Event Stream ○ Page Navigation Events ■ Links Clicks, Search Events ○ Browsing Information Events ■ Analyzing a component information (Focus, Scrolling, Resizing, etc) ■ Multi Focus Analysis (selection patterns) ○ Component Interaction Events ■ Changing the component state (submitting a form, select a value that changes the state of the component)
  • 32.
    Dynamic Content Selection ●Shopping Cart Event Stream ○ Add Product To Cart ○ Remove Product From Cart ○ Checkout Products ○ Empty Cart
  • 33.
    Dynamic Content Selection ●Use Cases for Single User ○ Single Focus Interest Period ■ Offer Discount ○ Multi Focus / Pattern Selection ■ Related Product Suggestion ○ Abandoned Shopping Cart ■ Warning ○ Checkout Shopping Cart Quickly ■ Related Product Offer
  • 34.
    Dynamic Content Selection ●Single Focus Interest Period ○ Offer Discount
  • 35.
    Dynamic Content Selection ●Multi Focus / Pattern Selection ○ Related Product Suggestion
  • 36.
    Dynamic Content Selection ●Abandoned Shopping Cart ○ Warning
  • 37.
    Dynamic Content Selection ●Checkout Shopping Cart Quickly ○ 10% Discount Voucher for future shops
  • 38.
    Related Links ● Youcan find more information, examples, tutorials and more in: ○ Salaboy Blog ■ http://salaboy.wordpress.com ○ Esteban Blog ■ http://ilesteban.wordpress.com ○ Plug Tree Blog ■ http://www.plugtree.com
  • 39.
        Questions?
  • 40.
    Enjoy! Questions andFeedback are always appreciated!
  • 41.
        Contact us at www.plugtree.com