• Like
  • Save
JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
Upcoming SlideShare
Loading in...5
×
 

JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE

on

  • 9,865 views

This session will introduce JBoss Drools - Popular business rules engine and JBoss Drools Fusion - a complex event processing engine which is an extension to business rules....

This session will introduce JBoss Drools - Popular business rules engine and JBoss Drools Fusion - a complex event processing engine which is an extension to business rules.

Business Rules bring in a new paradigm of programming which helps effectively separate business policies and application code. Enterprises can now build agile applications that quickly react to change in market conditions or internal operations.

Bringing in complex event processing into the same paradigm, these applications can now react to real time events in the business environment. Essentially with the use of Business Rules and CEP enterprise applications can be lot more agile than ever before.

Statistics

Views

Total Views
9,865
Views on SlideShare
9,861
Embed Views
4

Actions

Likes
8
Downloads
451
Comments
0

1 Embed 4

http://www.slashdocs.com 4

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE Presentation Transcript

      • JBoss Drools and Drools Fusion (CEP): Making Business Rules react to RTE
        Tihomir Surdilovic [email_address] JBoss, a Division of Red Hat
      • Agenda
      • Project (Drools) vs. Product (BRMS)
      • Drools Vision
      • Drools History
      • Drools at a glance
        • Expert
        • Guvnor
        • JBPM5
      • Focus on Drools Fusion (CEP Extensions)
        • Event Declaration and Semantics
        • Event Cloud, Streams and the Session Clock
        • Temporal Reasoning
        • Sliding Window Support
        • Streams Support
        • Memory Management
      • Questions & Answers
      • Project vs. Product
      Repository Rules and Metadata JBoss Enterprise BRMS Platform JBoss Rules Rules Engine/ Execution Rules Development & Management CEP Complex Events Jboss EWP
      • Project vs. Product Cont.
      • Stand-alone Framework
      • Innovation
      • Fast and Frequent Releases
      • Tested on developer environments
      • Suitable for development and prototype
      • No Patches – On to next big thing
      • Non SLA bound forum support
      • Fully Integrated Platform
      • Same Innovated Code + Stability
      • Stability – Includes usability, performance and security issues identified during productization
      • Certified for Multi-OS, Multi-DB
      • Best for Development and Production
      • 5 Yr lifecycle – Includes patches, updates, backward compatibility
      • SLA based full support from dedicated support engineers
      • Open Source Assurance – legal protection
      derived
      • Jboss community and Enterprise Changes
      Community / Enterprise Platform Delta BRMS Drools Enterprise Platforms - Performance, Scalability, Security and Quality improves over time without compromising long-term compatibility. 08/09 12/10 03/11 05/11 Over 150+ defect fixes & 35+ OS/JVM/DB certifications (& counting) between Drools Community 5.1 & JBoss BRMS 5.1.x
      • Evolution of Jboss BRMS
      05/08 04/09 12/10 ?
      • Lightweight Business Rules Engine
      • Business Rules Engine
      • Authoring and Management App
      • Repository
      • EAP Certified
      • DBs, JVMs
      • Business Rules Engine
      • Authoring and Management App
      • Choice of Repository
      • Integrated Container
      • CEP – Tech Preview
      • EAP, EWS, EWP, JVMs, Dbs and more
      • Performance
      Repository JBoss Enterprise BRMS Platform 5.0 JBoss Rules BRM Repository JBoss Enterprise BRMS Platform 5.1 JBoss Rules BRM CEP Jboss EWP
      • “ A common platform to model and govern the business logic of the enterprise.”
        Drools Vision
      • Drools Vision Cont.
      Event Processes Semantic Ontologies Workflows Rules Rules Workflows Event Processes Semantic Ontologies
      • Drools History – Business Rule Engines
      1980s 2010s 1990s 2000s OPS5 ART Clips Jess Drools 2 JRules Drools 3 Drools 4 Drools 5
      • Drools History
      • Drools 2
        • Rete like XML Scripting language
      • Drools 3
        • Based on Clips functionality
        • Iterative improves to JRules syntax with Clips functionality
      • Drools 4
        • More declarative
        • Basic functional programming feature with “from”
        • Basic Rule Flow
        • Basic BRMS
      • Drools 5
        • Improved functional programming with 'accumulate'
        • More Advanced Rule Flow integration
        • Complex Event Process
          • Temporal Comparators
          • Sliding Time Windows
        • Production ready BRMS (Guvnor)
      • Drools History Cont.
      • Drools 5.1
        • Differential Diff (true modify)
      • Drools 5.2 (this month, 5.2.0.CR1 available for download)
        • Freeform expressions between patterns
        • Multi-function accumulates
        • Prolog like derivation queries
        • Decision tables and rule templates (Guvnor)
        • Pure GWT (Guvnor)
      • Sample Industries and Users
      • Investment
        • Millennium Investment Group (MIG)
      • Logistics
        • Fedex
      • Airline
        • Sabre
      • Mortgage
        • Franklin American
      • Healthcare
        • OSDE
      • Drools at a glance - Declarative programming
      • Production Rule Systems PRD (forward chaining)
        • Reactive
        • when Alarm( status == “alert” ) then send( “warning” )
      • Logic Programming LP (backward chaining)
        • Query
        • descendant( “mary”, “jane”)
      • Functional Programming FP
        • Map,Fold, Filter
        • avg([12, 16, 4, 6])
          • Returns single value 9.5
        • round([10.3, 4.7, 7.8] )
          • Returns List [10, 5, 8]
      • Description Logic (model concepts, roles, and individuals)
        • Person Has Name and lives at Address
      • Drools Expert at a glance – Example A - SQL comparison example
      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
      • Drools Expert at a glance – Rules as a view
      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 rule “decrease balance for AccountPeriod Debits” when ap : AccountPeriod() acc : Account( $accountNo : accountNo ) CashFlow( type == DEBIT, accountNo == $accountNo, date >= ap.start && <= ap.end, $ammount : ammount ) then acc.balance -= $amount; end
      • Drools Expert at a glance – Example A - Building and executing rules
      • Drools Expert at a glance – Example A Building and executing rules cont.
      • Building
      • Executing
      • Drools Expert at a glance – Example B - Building and executing rules
      • Drools Expert at a glance – Example B cont.
      • No Fires
      • Add some Fires
      • Drools Expert at a glance – Example B cont.
      • Fires are put out after a while
      • Drools Expert at a glance – Conditional Elements
      • Drools Expert at a glance – Accumulate CE
      • Bus Example
      • Accumulate general syntax
      • Bus Example Revisited (no accumulate functions)
      • Drools Expert at a glance – Conditional Elements
      • From
      • Drools Expert at a glance – Timers and Calendars
      • Interval Timers
      Field Name Mandatory? Allowed Values Allowed Special Characters Seconds YES 0-59 , - * / Minutes YES 0-59 , - * / Hours YES 0-23 , - * / Day of month YES 1-31 , - * ? / L W Month YES 1-12 or JAN-DEC , - * / Day of week YES 1-7 or SUN-SAT , - * ? / L # Year NO empty, 1970-2099 , - * /
      • Cron-based Timers
      • Drools Expert at a glance – Timers and Calendars
      • Calendars
      • Using Timers and Calendars together
      Execute now and after 1 hour duration on week days Execute now and after 4 hour duration on weekend days
      • Drools Expert at a glance – Truth maintenance and Inference
      • Issuing Buss passes – typical rule implementation
      • Good practice to do:
        • De-couple knowledge responsibilities
        • Encapsulate knowledge
        • Provide semantic abstractions for those encapsulation
        • Integrity robustness – truth maintenance
      • These types of implementations are considered
        • Bad
        • Monolithic
        • Leaky
        • Brittle integrity - manual maintenance
      Couples the logic What happens when the Child becomes 16?
      • Drools Expert at a glance – Truth maintenance and Inference cont.
      • De-coupling knowledge responsibilities
      De-couples the logic Maintains the truth by automatically retracting.
        Rule “logically” inserts an object. When the rule is no longer true, the object is retracted.
      The truth maintenance cascades
      • Drools Expert at a glance – Truth maintenance and Inference cont.
      • Notification upon automatic fact retraction
      • Executing
      The truth maintenance cascades
      • Drools Expert at a glance – Roadmap
      • Improved backward chaining (open queries)
      • Optimistic backward chaining.
      • Business Semantics (ontologies)
      • Simulation Testing
      • High Availability
      • Distributed (Grid) platform
      • Runtime Management
      • BAM (Business Activity Monitoring)
      • Drools Guvnor at a glance
      • Technology
        • JCR 2.0 (JSR-170) backend
        • Seam 2 + GWT frontend
        • WebDav
        • Eclipse synchronisation plugin
        • Role based security
      • Authoring
        • Decision Tables
        • Guided Editor
      • QA
        • Scenario Testing + Rule Verification
      • Drools Guvnor at a glance – Business asset storage
      • Drools Guvnor at a glance – Guided Editor
      • Drools Guvnor at a glance – Decision Tables
      • Drools Guvnor at a glance – Scenario Testing
      • Drools Guvnor at a glance – BPMN2 processes
      • Drools Guvnor at a glance – Compiling and exposing rule packages
      • jBPM5 at a glance – What is BPM?
      Business Process Management A business process is a process that describes the order in which a series of steps need to be executed, using a flow chart.
      • jBPM5 at a glance – Why BPM?
      • Visibility
      • Monitoring
      • Higher-level
      • Continuous improvement
      • Speed of development
      • Increased agility
      • jBPM5 at a glance – Key Characteristics
      • Open-source business process management project offering:
        • generic process engine supporting native BPMN 2.0 execution
        • targeting developers and business users
        • collaboration, management and monitoring using web-based consoles
        • powerful rules and event integration
      • Core engine is a workflow engine in pure Java
        • state transitions
        • lightweight
        • embeddable
        • generic, extensible
      Core Engine
      • jBPM5 at a glance – Core Engine
      // (1) Create knowledge base and add process definition KnowledgeBuilder kbuilder = ... kbuilder.add( ..., &quot;sample.bpmn&quot;, ResourceType.BPMN2); KnowledgeBase kbase = kbuilder.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); // (2) Create new stateful knowledge session StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); // (3) Start a new process instance ksession.startProcess(“com.sample.bpmn.hello”); Knowledge Base Stateful Knowledge Session Process Definition Process Instance
      • jBPM5 at a glance – BPMN 2.0
      • OMG specification
        • Model
        • Notation
        • Execution semantics
      • Understandable by all business users
      • Process, collaboration, choreography
      • Extensible
      < definitions ... > < process id=&quot;com.sample.bpmn.hello&quot; name=&quot;Hello World&quot; > < startEvent id=&quot;_1&quot; name=&quot;StartProcess&quot; /> < sequenceFlow sourceRef=&quot;_1&quot; targetRef=&quot;_2&quot; /> < scriptTask id=&quot;_2&quot; name=&quot;Hello&quot; > < script >System.out.println(&quot;Hello World&quot;);</ script > </ scriptTask > < sequenceFlow sourceRef=&quot;_2&quot; targetRef=&quot;_3&quot; /> < endEvent id=&quot;_3&quot; name=&quot;EndProcess&quot; /> </ process > </ definitions > Core Engine BPMN 2.0 XML
      • jBPM5 at a glance – Persistence and Transactions
      • Persistence (JPA, pluggable)
        • Runtime persistence
        • History logging
        • Services
      • Transactions (JTA, pluggable)
        • Command-scoped
        • User-defined
      Core Engine BPMN 2.0 XML Persistence Trans- actions JPA JTA
      • jBPM5 at a glance – Console
      • Web-based management
      • Business user
      • Features
        • Process instance management
        • User task lists / forms
        • Reporting
      Core Engine BPMN 2.0 XML Persistence Trans- actions Events History Log Management Console BAM
      • jBPM5 at a glance – Console
      • Domain-specific Processes:
        • Extend palette with
        • domain-specific, declarative
        • service nodes
          • define input / output parameters
          • runtime binding
      • User task
      • Human task service (WS-HT)
        • Task lists
        • Task life cycle
      • Task clients
        • Task forms
      Core Engine BPMN 2.0 XML Persistence Trans- actions Events Integration Domain-specific Processes Human Task Service ESB
      • jBPM5 at a glance – Roadmap
      • jBPM 5.0: February 2011
      • jBPM 5.1: NOW ...
        • Improve Oryx BPMN2 designer to support full round-tripping
        • New Eclipse BPMN2 editor
        • Lots of small feature improvements and bug fixes
      • jBPM 5.2 – jBPM 6.x
        • Simulation / testing / replay
        • Flexible, adaptive, goal-oriented processes
        • Integrated “no-code” tooling (form builder, etc.)
      • Focus on Drools Fusion (CEP)
      • Brief introduction on CEP and Terminology
      • Drools Vision
      • Drools Fusion: Complex Event Processing extensions
        • Event Declaration and Semantics
        • Event Cloud, Streams and the Session Clock
        • Temporal Reasoning
        • Sliding Window Support
        • Streams Support
        • Memory Management
      • Drools Fusion – What is an Event?
        • “ An event is an observable occurrence .”
        • “ An event in the Unified Modelling Language is a notable occurrence at a particular point in time .”
        • http://www.wikipedia.org
        • “ Anything that happens , or is contemplated as happening .”
        • “ An object that represents, encodes or records an event , generally for the purpose of computer processing ”
        • http://complexevents.com
        • For the scope of this presentation:
        • “ An event is a significant change of state at a particular point in time ”
      • Drools Fusion – What is a Complex Event?
        • “ Complex Event , is an abstraction of other events called its members.”
      • Examples :
        • The 1929 stock market crash – an abstraction denoting many thousands of member events, including individual stock trades)
        • The 2004 Indonesian Tsunami – an abstraction of many natural events
        • A completed stock purchase -an abstraction of the events in a transaction to purchase the stock
        • A successful on-line shopping cart checkout – an abstraction of shopping cart events on an on-line website
        • Source: http://complexevents.com
      • Drools Fusion – What is Complex Event Processing (CEP)?
        • “ Complex Event Processing , or CEP, is primarily an event processing concept that deals with the task of processing multiple events with the goal of identifying the meaningful events within the event cloud.
        • CEP employs techniques such as detection of complex patterns of many events, event correlation and abstraction , event hierarchies, and relationships between events such as causality, membership, and timing, and event-driven processes.”
        • -- wikipedia
      • Drools Fusion – CEP Scenarios
      • Examples:
        • Emergency Response Systems
        • Credit Card Fraud Detection
        • Logistics Real-Time Awareness solution
        • Neonatal ICU: infant vital signs monitoring
      • A few characteristics of common CEP scenarios:
        • Huge volume of events, but only a few of real interest
        • Usually events are immutable
        • Usually queries/rules have to run in reactive mode
        • Strong temporal relationships between events
        • Individual events are usually not important
        • The composition and aggregation of events is important
      • Drools Fusion – CEP vs. ESP
        • Complex Event Processing , or CEP, and Event Stream Processing , or ESP, are two technologies that were born separate, but converged .
      • An oversimplification : In their origins...
        • Event Stream Processing focused on the ability to process high volume streams of events.
        • Complex Event Processing focused on defining, detecting and processing the relationships among events.
        • For the scope of this presentation:
        • “ CEP is used as a common term meaning both CEP and ESP .”
      • Drools Fusion – EDA
        “ Event Driven Architecture (EDA) is a software architecture pattern promoting the production , detection , consumption of, and reaction to events. An event can be defined as &quot;a significant change in state&quot;[1]. For example, when a consumer purchases a car, the car's state changes from &quot;for sale&quot; to &quot;sold&quot;. A car dealer's system architecture may treat this state change as an event to be produced, published, detected and consumed by various applications within the architecture.” http://en.wikipedia.org/wiki/Event_Driven_Architecture
        CEP is a component of the EDA
      • Drools Fusion – EDA vs SOA
      • EDA is **not** SOA 2.0
      • Complementary architectures
      • Metaphor
        • In our body :
          • SOA is used to build our muscles and organs (what's needed to DO things)
          • EDA is used to build our sensory system (what's needed to REACT TO things)
      • Drools Fusion – CEP Characteristics
      • A few characteristics of common CEP scenarios:
        • Huge volume of events, but only a few of real interest
        • Usually events are immutable
        • Usually queries/rules have to run in reactive mode
        • Strong temporal relationships between events
        • Individual events are usually not important
        • The composition and aggregation of events is important
      • Drools Fusion – Enables...
      • Event Detection:
        • From an event cloud or set of streams, select all the meaningful events, and only them.
      • [Temporal] Event Correlation:
        • Ability to correlate events and facts declaring both temporal and non-temporal constraints between them.
        • Ability to reason over event aggregation
      • Event Abstraction:
        • Ability to compose complex events from atomic events AND reason over them
      • Drools Fusion – Features
      • Features:
        • Event Semantics as First Class Citizens
        • Allow Detection, Correlation and Composition
        • Temporal Constraints
        • Session Clock
        • Stream Processing
        • Sliding Windows
        • CEP volumes (scalability)
        • (Re)Active Rules
        • Data Loaders for Input
      • Drools Fusion – Demo
      • Twitter Stream CEP Demo:
        • Listen to the Twitter Stream API
          • Twitter4J API
          • Listens to a random sample of tweets
        • Detects patterns and reacts
          • Drools Fusion
        • Simple one process (multi-thread) demo
          • Focus on specific features
      • Drools Fusion – Event Declaration and Semantics
      • Event semantics:
        • Point-in-time and Interval
      • An event is a fact with a few special characteristics:
        • Usually immutable , but not enforced
        • Strong temporal relationships
        • Lifecycle may be managed
        • Allow use of sliding windows
      • “ All events are facts , but not all facts are events.”
      • Demo twitter rules part 1, 2, 3)
        // declaring existing class import some.package.VoiceCall declare VoiceCall @role ( event ) @timestamp ( calltime ) @duration ( duration ) end // generating an event class declare StockTick @role ( event ) symbol : String price : double end
      • Drools Fusion – Temporal Reasoning
      • Semantics for:
        • time: discrete
        • events: point-in-time and interval
      • Ability to express temporal relationships:
        • Allen’s 13 temporal operators
      • James F. Allen defined the 13 possible temporal relations between two events.
      • Eiko Yoneki and Jean Bacon defined a unified semantics for event correlation over time and space.
      • Drools Fusion – Temporal Relationships
        rule “Shipment not picked up in time” when Shipment ( $pickupTime : scheduledPickupTime ) not ShipmentPickup ( this before $pickupTime ) then // shipment not picked up... Action required. end
        Temporal Relationship
      • Drools Fusion – Allen’s 13 Temporal Operators
        Point-Point
        Point-Interval
        Interval-Interval
        A before B
        A meets B
        A overlaps B
        A finishes B
        A includes B
        A starts B
        A coincides B
        A
        B
        A
        B
        A
        B
        A
        B
        A
        B
        A
        B
        A
        B
      • Drools Fusion – Allen’s 13 Temporal Operators
        Point-Point
        Point-Interval
        Interval-Interval
        A after B
        A metBy B
        A overlapedBy B
        A finishedBy B
        A during B
        A finishes B
      • Demo twitter rules part 4
        A
        B
        A
        B
        A
        B
        A
        B
        A
        B
        A
        B
      • Drools Fusion – Streams : Simple Example Scenario
      • Drools Fusion – Stream Support (entry-points)
      • A scoping abstraction for stream support
        • Rule compiler gather all entry-point declarations and expose them through the session API
        • Engine manages all the scoping and synchronization behind the scenes.
        rule “Stock Trade Correlation”
      • when
      • $c : Customer( type == “VIP” )
      • BuyOrderEvent( customer == $c , $id : id ) from entry-point “Home Broker Stream”
      • BuyAckEvent( sourceEvent == $id ) from entry-point “Stock Trader Stream”
      • then
      • // take some action
      • end
      • No notion of “flow of time” : the engine sees all facts without regard to time
      • No attached Session Clock
      • No requirements on event ordering
      • No automatic event lifecycle management
      • No sliding window support
      • Notion of “flow of time” : concept of “now”
      • Session Clock has an active role synchronizing the reasoning
      • Event Streams must be ordered
      • Automatic event lifecycle management
      • Sliding window support
      • Automatic rule delaying on absence of facts
        Drools Fusion – Cloud Mode, Stream Mode, Session Clock
        CLOUD
        STREAM
      • Drools Fusion – Reference Clock
      • Reference clock defines the flow of time
      • Named Session Clock
        • is assigned to each session created
      • Synchronizes time sensitive operations
        • duration rules
        • event streams
        • process timers
        • sliding windows
      • Drools Fusion – Session Clock
      • Uses the strategy pattern and multiple implementations:
        • Real-time operation
        • Tests
        • Simulations
        • etc
      • Drools Fusion – Session Clock
      • Selecting the session clock:
        • API:
          • KnowledgeSessionConfiguration conf = ...
          • conf.setOption( ClockTypeOption.get( “realtime” ) );
        • System Property or Configuration File:
        drools.clockType = pseudo
      • Drools Fusion – Sliding Window Support
      • Allows reasoning over a moving window of “interest”
        • Time
        • Length
      Sliding window 1 Sliding window 2
      • Drools Fusion – Sliding Window Support
      • Allows reasoning over a moving window of “interest”
        • Time
        • Length
      Sliding window 1 Sliding window 2 Joined window
      • Drools Fusion – Sliding Window Support
      • Allows reasoning over a moving window of “interest”
        • Time
        • Length
      • Demo twitter rules part 5
        rule “Average Order Value over 12 hours” when $c : Customer() $a : Number() from accumulate ( BuyOrder( customer == $c , $p : price )
      • over window:time ( 12h ),
      • average ( $p ) )
      • then
      • // do something
      • end
      • Drools Fusion – Delaying Rules
      • Negative patterns may require rule firings to be delayed.
        rule “Order timeout” when $bse : BuyShares ( $id : id ) not BuySharesAck( id == $id , this after[0s,30s] $bse ) then // Buy order was not acknowledged. Cancel operation // by timeout. end
        Forces the rule to wait for 30 seconds before firing, because the acknowledgement may arrive at any time!
      • Drools Fusion – Temporal Dimension
      • Requires the support to the temporal dimension
        • A rule/query might match in a given point in time, and not match in the subsequent point in time
      • That is the single most difficult requirement to support in a way that the engine:
        • stays deterministic
        • stays a high-performance engine
      • Achieved mostly by compile time optimizations that enable:
        • constraint tightening
        • match space narrowing
        • memory management
      • Drools Fusion – Temporal Dimension Support
      • CEP scenarios are stateful by nature.
      • Events usually are only interesting during a short period of time .
      • Hard for applications to know when events are not necessary anymore
        • Temporal constraints and sliding windows describe such “ window of interest ”
      • Drools Fusion – Simple Example Rule
        rule “Bag was lost” when $b : BagScannedEvent() from entry-point “check-in” not BagScannedEvent( id == $b.id , this after[0s,5m] $b )
      • from entry-point “pre-load”
      • then
      • // Bag was lost, do something
      • end
      Easy to “see” that the only temporal relationship between the events defines a 5 minutes interest window.
      • Drools Fusion – Abstract Example Rule
        rule “Abstract event relationship example” when $a : A() $b : B( this after[-2, 2] $a ) $c : C( this after[-3, 4] $a ) $d : D( this after[ 1, 2] $b, this after[2,3] $c ) not E( this after[ 1,10] $d ) then // Bag was lost, do something end
      How about now? What is the temporal relationship between A and E?
      • Drools Fusion – Temporal Dependency Matrix
        A
        B
        C
        D
        E
        A
        [ 0, 0 ]
        [ -2, 2 ]
        [ -3, 2 ]
        [ -1, 4 ]
        [ 0, 14 ]
        B
        [ -2, 2 ]
        [ 0, 0 ]
        [ -2, 0 ]
        [ 1, 2 ]
        [ 2, 12 ]
        C
        [ -2, 3 ]
        [ 0, 2 ]
        [ 0, 0 ]
        [ 2, 3 ]
        [ 3, 13 ]
        D
        [ -4, 1 ]
        [ -2, -1 ]
        [ -3, -2 ]
        [ 0, 0 ]
        [ 1, 10 ]
        E
        [ -14, 0 ]
        [ -12, -2 ]
        [ -13, -3 ]
        [-10,-1 ]
        [ 0, 0 ]
      Constraint tightening
      • Demo twitter rules part 6
        [-2,2]
        [-3,4]
        [2,3]
        [1,2]
        [1,10]
        A
        D
        B
        E
        C
      • Q&A
      • Drools project site:
        • http://www.drools.org ( http://www.jboss.org/drools/ )
      • Documentation:
        • http://www.jboss.org/drools/documentation.html
      • Tihomir Surdilovic – tsurdilo @redhat.com