• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Drooling for drools (JBoss webex)

on

  • 2,535 views

 

Statistics

Views

Total Views
2,535
Views on SlideShare
2,535
Embed Views
0

Actions

Likes
2
Downloads
133
Comments
0

0 Embeds 0

No embeds

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

    Drooling for drools (JBoss webex) Drooling for drools (JBoss webex) Presentation Transcript

    • Mark Proctor Co-Creator Project Lead
      • T he SkyNet funding bill is passed.
      • The system goes online on August 4th, 1997.
      • Human decisions are removed from strategic defense.
      • SkyNet begins to learn at a geometric rate.
      • It becomes self-aware at 2:14am Eastern time, August 29th
      • In a panic, they try to pull the plug.
      • And, Skynet fights back
    • Topics
      • What's new in 5.1
      • Drools and OSS Community
      • History
      • Unified Vision
      • Expert
      • Fusion
      • Flow
    • What's new In 5.1
    • What's new to 5.1
      • Integration
        • OSGi ready
        • Spring
        • Camel
        • JMX/JOPR integration
      • Expert
        • New Rete Algorithm “differential update”
        • Timers and Calendars
        • Live Open Querries
      • Flow
        • BPMN2
    • Differential Update
      • Differential Update (a.k.a. “true modify”)
        • Implements a real “modify/update” operation, instead of retract+assert.
          • Reuses tuples, reduces GC stress, improves performance
    • What's new to 5.1
      • Guvnor
        • Guided editor
          • Nested Expression builder
            • person.dogs[0].name
          • Move constrains up and down
          • Insert constraints
          • Support for more DRL elements
        • RSS Subcription, change notifications, inbox
        • Working Sets
        • Object constraint definitions
        • Rule Templates (based on Guided Editor)
        • Oryx BPM editor integration
        • Better rule documentation support
    • Drools flow in Oryx
    • Drools flow in Eclipse
    • Community
    • Books
    • Boot Camps
      • San Francisco 2009 (40+ attendees)
        • Sponsored by Third Pillar
        • Sun, FAMC, OSDE, Kaseya, Fedex, TU Group, Intermountain Healthcare, Gap, Sony Pictures, Lockheed Martin, Kaiser, HP, Wells Fargo, US Navy Research, FOLIOfn, Boeing .....
      • San Diego 2010 (80+ attendess)
        • Sponsored by US Navy
        • 5 day event, with 2 days focus on the healthcare industry
        • OSDE, AT&T, SAIC, US Navy Research, Kaiser, Clinica, Intermountain Healthcare, GE Healthcare, VA, Boeing, Nationwide ....
    • Boot Camps
      • Rules Fest 11 th October
        • 3 day conferene + 1 day boot camp
      • USA and EMA in Febuary, watch blog for news
        • http://blog.athico.com
    • Community Collaboration
      • 40% of Drools work now done in the community
        • US Navy Healthcare
        • OSDE (Argentina's largest healthcare organisation)
        • Intalio
    • Sample Industries and Users
      • Investment
        • Millennium Investment Group (MIG)
      • Logistics
        • Fedex
      • Airline
        • Sabre
      • Mortgage
        • Franklin American
      • Healthcare
        • OSDE
    • History
    • It All Started Here Birth of CDSS 1970s 1980s Dendral Baobab Mycin Guidon Neomycin Teiresias Puff Emycin WM Sacon Centaur Wheeze Gravida Clot Oncocin
    • Because Not Everyone Is As Smart As He Is
    • Business Rules 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 (Fusion)
          • Temporal Comparators, Sliding Time Windows
        • Production ready BRMS
    • Unified Vision
    • Drools Modules
    • Drools Modules
    • Business Logic Lifecycle
    • Rules and processes loosely coupled tightly coupled specific generic Decision Services Process Rules SCOPE COUPLING ?
    • Event Driven Architectures edBPM + EDM
    • Domain Overview
    • Domain Overview
    • Hybrid Logic Engine
      • 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
        • Person hasName String and livesAt Address
      • Production Rule Systems PRD (forward chaining FC)
        • Drools 5.0, OPSJ ( hyrbid BC), ART( hyrbid BC)
      • Logic Programming LP (backward chaining BC)
        • target : Prolog (POSL Position Slotted Language)
        • Drools Trunk has a prototype Prolog like query backward chaining capabilities. Stronger Polog like capabilities planned.
        • Opportunistic BC planned.
      • Functional Programming FP
        • Lisp, Haskell
        • Drools 5.0 has some functional capabilities
        • Drools 5.1, 5.2 will be looking to have strong functional capabilities
      Hybrid Logic Engine
      • Description Logic DL
        • KIF, OWL-DL
        • Planned, See “The Future”
      Hybrid Logic Engine
    • The Future
      • Full Hybrid Engine
        • http://community.jboss.org/wiki/DroolsLanguageEnhancements
      • Nested Objects
      • Casting Nested Objects
      • Positional Constraints
      • POSL - Positional-Slotted Language
      • Method Calls
      • Maps and Arrays (Collections)
      • Collections and XPath like filtering
      • Free form Expressions
      • Managed Object Graphs (MOGS)
      • Nested Patterns and Queries
      • Queries and Unification
      • Ontologies and Relations via
      • Query Based Backward Chaining with POSL
      • Triples with Hybrid POJO Graph Notation.
      • Escapes for Dialects
      • Accumulate Improvements to Support Haskell map/fold/filter and MVEL projection/fold
      • Otherwise
      • Branch (Labelled Else)
      • Rule Execution Groups
      • Rule Dependency Meta-Rule Language
      • Parallel Meta-Rule Language
      • Field Versioning
      • Logical Closures/OnFalse
      • Opportunistic Backward Chaining, Lazy Field/Object Values
      • ...
    • Achieving More By Doing Less
    • jBPM File file = new File (“.....”); // file to XML process definition ProcessDefinition processDefinition = ProcessDefinition.parseXmlString( IoUtils.FileToString( file ) ); ProcessInstance processInstance = new ProcessInstance(processDefinition); Jess Rete engine = new Rete(); FileReader file = new FileReader("myfile.clp"); Jesp parser = new Jesp(file, engine); parser.parse(false); Esper EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(); EPStatement countStmt = admin.createEPL( "...." ); countStmt.start(); Knowledge API
    • Drools Flow KnowledegBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBulider(); kbuilder.addResource( ResourceFactory.newClassPathResource( “myflow.bpmn2”, ResourceType.BPMN2 ); If ( kbuilder.hasErrors() ) { log.error( kbuilder.hasErrors().toString() ); } KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages( kbase.getKnowledgePackages() ); Knowledge API
    • Drools Expert KnowledegBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBulider(); kbuilder.addResource( ResourceFactory.newClassPathResource( “myrules.drl”, ResourceType.DRL ); If ( kbuilder.hasErrors() ) { log.error( kbuilder.hasErrors().toString() ); } KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages( kbase.getKnowledgePackages() ); Knowledge API
    • Drools Integration Deployment Descriptors <change-set> <add> <resource source='classpath:myapp/data/myflow.bpmn2' type='BPMN2' /> <resource source='http:myapp/data/myrules.drl' type='DRL' /> <resource source='classpath:data/IntegrationExampleTest. xls ' type=&quot;DTABLE&quot;> <decisiontable- conf input-type=&quot;XLS&quot; worksheet-name=&quot;Tables_2&quot; /> </resource> <add> </change-set> KnowledegBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBulider(); kbuilder.addResource( ResourceFactory.newFileResource( “changeset.xml”, ResourceType.ChangeSet ); Knowledge XML
    • <drools:kbase id=&quot;kbase1&quot;> <drools:resource type=&quot;DRL&quot; source=&quot;classpath:.../testSpring.drl&quot; /> </drools:kbase> <drools:ksession id=&quot;ksession1&quot; type=&quot; stateless &quot; kbase =&quot;kbase1&quot; /> <drools:ksession id=&quot;ksession2&quot; type=&quot; stateful &quot; kbase =&quot;kbase1&quot;/> <camelContext id=&quot;camel&quot;> <route> <from uri=&quot;cxfrs://bean://rsServer&quot;/> <marshal ref=&quot;xstream&quot;/> <to uri=”drools:ksession1” /> <unmarshal ref=&quot;xstream&quot;/> </route> </camelContext> Declarative Services Spring XML and Camel
    •  
    • Integrated debug and audit
    • Simulation Testing
    • Drools Expert
    • Classes
    • 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 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 Credit Cashflow Rule
    • 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 Rules as a “view”
    • Conditional Elements
    • not Bus( color = “red” ) Conditional Elements exists Bus( color = “red” ) forall ( $bus : Bus( floors == 2 ) Bus( this == $bus, color == “red” ) ) forall ( $bus : Bus( color == “red” ) )
    • Accumulate CE rule &quot;accumulate&quot; when acc ( Bus( color == &quot;red&quot; , $t : takings ); $min : min( $t ), $max : max( $t ); $min > 100 && $max < 200 ) then println( &quot;range is “ + $min + “ “ + $max ); end
    • Accumulate CE Patterns and CE's can be chained with ' from ' rule &quot;collect&quot; when $zipCode : ZipCode() acc ( Bus( color == &quot;red&quot; , $t : takings ) from $hbn.getNamedQuery( “Find Buses” ) .setParameters( [ “zipCode” : $zipCode ] ).list(); $sum : sum( $t ); $sum > 100 ) then print &quot;sum is “ + $sum; end
    • Live Queries
    • Live Queries query (String $region, int $min, int $max ) { $c : Cheese( region == $region, price > $min && price < $max ) exists( StockItem( type == $c ) } ViewChangedEventListener listener = new ViewChangedEventListener() { public void rowUpdated(Row row) { println( &quot;updated&quot; + row.get( &quot;$c&quot; ) ); } public void rowRemoved(Row row) { println( &quot;removed&quot; + row.get( &quot;$c&quot; ) ); } public void rowAdded(Row row) { println( &quot;added&quot; + row.get( &quot;$c&quot; ) ); } };
    • Live Queries LiveQuery query = ksession.openLiveQuery( &quot;cheeses&quot;, new Object[] { &quot;devon&quot;, 10, 50 }, listener ); ... ... query.dispose()
    • Timers Calendars
    • Timers rule “name” timer (int: 1m30s 0) when $l : Light( status == “on” ) then modify ( $l ) { status = “off” }; When the light is on, and has been on for 1m30s then turn it off
    • Timers rule “name” timer ( cron: 0 0/15 * * * * ) when Alarm( ) then sendEmail( ”Alert Alert Alert!!!” ) 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 , - * / Send alert every quarter of an hour
    • Calendars rule &quot;weekdays are high priority&quot; calendars &quot;weekday&quot; timer (int:0 1h) when Alarm() then send( &quot;priority high - we have an alarm” ); end rule &quot;weekend are low priority&quot; calendars &quot;weekend&quot; timer (int:0 4h) when Alarm() then send( &quot;priority low - we have an alarm” ); end Execute now and after 1 hour duration Execute now and after 4 hour duration
    • Drools Expert Authoring Metaphores
    • Guided Editor
    • Decision Table
    • Decision Table rule &quot;Pricing bracket_10&quot; when Driver(age >= 18, age <= 24, locationRiskProfile == &quot;LOW&quot;, priorClaims == &quot;1&quot;) policy: Policy(type == &quot;COMPREHENSIVE&quot;) then policy.setBasePrice(450); end
    • Fusion
    • 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 Sequencing:
        • A -> ( B OR C ) -> D
      • Event Abstraction:
        • Ability to compose complex events from atomic events AND reason over them
    • Drools Fusion: Features
      • Support to Event semantics:
        • Usually immutable, but not enforced
        • Strong temporal relationships
        • Managed lifecycle
        • Point-in-time and Interval events
      • Time semantics
        • Discrete
      • Temporal relationships
        • All 13 operators defined by James Allen (+ negations)
    • Drools Fusion: Temporal Reasoning
    • Drools Fusion: Temporal Reasoning
    • $c : Custumer( type == “VIP ) $oe : BuyOrderEvent( customer == $c ) from entry-point “Home Broker Stream” not BuyAckEvent( relatedEvent == $oe.id, this after[1s, 10s] $oe ) from entry-point “Stock Trader Stream” Operators Existing Drools 'not' Conditional Elements can be used to detect non-occurrence of events BackAckEvent must occur between 1s and 10s ' after' BuyOrderEvent
    • Aggregations Rule Engines do not deal with aggregations acc ( $s : StockTicker( symbol == “RHAT” ) over window:time ( 5s ); $avg : avg ( $s.price ); $avg > 100 ) Over 5 seconds Aggregate ticker price for RHAT over last 5 seconds
    • CEP Applied at FedEx Custom Critical
      • Time specific deliveries for critical freight
      • Exclusive use non-stop door-to-door services
      • Blended Surface and Air services to minimize cost and transit time
      • Extra care in handling and specially equipped vehicles
        • Temperature Control, Secured Services, Hazardous Material, Constant Surveillance
      * Presented by Adam Mollemkopf at ORF 2009
    • CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
    • CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
    • CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
    • CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
    • CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
    • CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
      • At least 50% of Alerts can be reasoned automatically, promoting staff savings and improved Customer and Driver experiences.
      • Risk Avoidance via pro-active monitoring
        • Reduction in insurance claims and shipment service failures
      • Minimum 30% efficiency gains in shipment monitoring , saving at least 15% of Operations staff cost.
      CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
      • Some numbers (from early 2010):
        • 24 x 7 sessions, no downtime
        • Average of 500k+ facts/events concurrently in memory
          • Business hours: 1M+ facts/events concurrently
        • Response time for reasoning cycles:
          • Average: 150 ms
          • Peak: 1.2 sec
        • Several hundred rules
      CEP Applied at FedEx Custom Critical * Presented by Adam Mollemkopf at ORF 2009
    • Drools Flow (jBPM5)
    • BPMN 2.0
      • OMG Standard that defines
        • Graphical notation
        • Process definition format (XSD/XMI)
        • Execution Semantics
      • Extensible
      • Interoperability
      • http://www.omg.org/spec/BPMN/2.0
    • Palette
      • Predefined set of generic node types
        • start, end
        • Gateway
        • Script
        • Sub-process
        • Event
        • ...
    • Drools flow in Eclipse
    • Drools flow in Oryx
    • Process Debugging
    • Domain-Specific Processes
    • Domain-Specific Processes
      • Other Examples
        • Email / notifications
        • File management: archive, find, copy
        • FTP, RSS, Jabber, Rest
        • ESB
        • Google Calendar, social websites
      • Library
    • Non Linear Processes
    • Rules and Process
    • Events and Processes declare ProcessStartedEvent @role( event ) end rule &quot;Number of process instances above threshold&quot; when acc( e: ProcessStartedEvent( processId == &quot;com.sample.order.OrderProcess&quot; ) over window:size(1h), $c : count(e), $c > 1000) then System.err.println( &quot;WARNING: Nb of order processes in the last hour > 1000: &quot; + nbProcesses ); end
    • Human Tasks - WS-HT
    • Questions? Questions?
      • Dave Bowman : All right, HAL; I'll go in through the emergency airlock.
      • HAL : Without your space helmet, Dave, you're going to find that rather difficult.
      • Dave Bowman : HAL, I won't argue with you anymore! Open the doors!
      • HAL : Dave, this conversation can serve no purpose anymore. Goodbye.
      Joshua: Greetings, Professor Falken. Stephen Falken : Hello, Joshua. Joshua: A strange game. The only winning move is not to play. How about a nice game of chess?