SlideShare a Scribd company logo
What a rule-based program is Drools Expert & Fusion Declarative (What to do) Vs. Imperative (How to do it) When should you use Drools? The problem is beyond any algorithmic
solution or isn't fully understood
The business-logic changes often
Domain expert or business analysts are readily
available but are nontechnical
You want to isolate the key parts of your logic
especially the really messy parts Complex Event Processing with Drools Fusion Understands and handles events as a first
class platform citizen (specialized Facts)
Selects a set of events in a cloud and detect
the relavant relationships among them
Takes appropriate action based on the patterns
detected and the events' temporal relationships rule   &quot;Acknowledgement Failure&quot;   when $req  : BuyReq() not BuyAck( this after[15s]  $req  ) then channel[ &quot;alerts&quot; ].send( new Alert(  $req  ) ); end rule   &quot;Buy More Stock”   when TradingWindow( status == OPEN ) Accumulate(  $t  : Ticker( name ==  “RHT” ) over window:time(4m), $avg  : avg(  $t .price ) ) eval(  $avg  > 100 ) then channel[ &quot;buy channel&quot; ].send( new BuyReq(  &quot;RHT&quot;  ) ); end   rule   &quot;Check age&quot;   when $a  : Applicant( age < 18 ) then modify(  $a  ) { valid = false } end Features Made up of discrete rules, each of them
models a specific aspect of your domain

More Related Content

Drools & jBPM Info Sheet

  • 1. What a rule-based program is Drools Expert & Fusion Declarative (What to do) Vs. Imperative (How to do it) When should you use Drools? The problem is beyond any algorithmic
  • 2. solution or isn't fully understood
  • 4. Domain expert or business analysts are readily
  • 5. available but are nontechnical
  • 6. You want to isolate the key parts of your logic
  • 7. especially the really messy parts Complex Event Processing with Drools Fusion Understands and handles events as a first
  • 8. class platform citizen (specialized Facts)
  • 9. Selects a set of events in a cloud and detect
  • 11. Takes appropriate action based on the patterns
  • 12. detected and the events' temporal relationships rule &quot;Acknowledgement Failure&quot; when $req : BuyReq() not BuyAck( this after[15s] $req ) then channel[ &quot;alerts&quot; ].send( new Alert( $req ) ); end rule &quot;Buy More Stock” when TradingWindow( status == OPEN ) Accumulate( $t : Ticker( name == “RHT” ) over window:time(4m), $avg : avg( $t .price ) ) eval( $avg > 100 ) then channel[ &quot;buy channel&quot; ].send( new BuyReq( &quot;RHT&quot; ) ); end rule &quot;Check age&quot; when $a : Applicant( age < 18 ) then modify( $a ) { valid = false } end Features Made up of discrete rules, each of them
  • 13. models a specific aspect of your domain
  • 14. Simpler because you can concentrate on the
  • 15. rules for one situation at time
  • 16. Flexible in the face of fragmentary or poorly
  • 17. conditioned inputs Made up of discrete rules, each of them
  • 18. models a specific aspect of your domain
  • 19. Simpler because you can concentrate on the
  • 20. rules for one situation at time
  • 21. Flexible in the face of fragmentary or poorly
  • 22. conditioned inputs Made up of discrete rules, each of them
  • 23. models a specific aspect of your domain
  • 24. Simpler because you can concentrate on the
  • 25. rules for one situation at time
  • 26. Flexible in the face of fragmentary or poorly
  • 27. conditioned inputs Hybrid reasoning Forward and Backward Chaining
  • 28. Reactive, Query and Materialized Views Functional Programming
  • 33. Dynamic Object Classification (Traits) Examples
  • 34. … with Apache Camel Drools Integration Sample Configuration - Camel Sample Configuration - Spring … with Spring Apache Camel is a powerful open source integration framework based on known Enterprise Integration Patterns. Drools ships with an Apache Camel endpoint implementation for out of the box integration with hundreds of other products that also integrate through Apache Camel. For a list of Apache Camel components, visit: http://camel.apache.org/ Spring is a popular framework for enterprise Java development. Drools ships with a Spring-ready module that allows Drools to be configured and deployed into the Spring container without any glue code. For more details on spring, visit: http://www.springsource.org Drools Server The Drools Execution Server (drools-server) module is a war, which can be deployed in a application server (such as JBoss AS), and allows applications to execute KnowledgeBases remotely for any sort of client application. This is not limited to JVM application clients, but any technology that can use HTTP, through a REST interface. The execution server leverages both Drools Camel and Drools Spring modules to support stateless and stateful sessions in a native way. Check the Drools Integration documentation for more information: www.jboss.org/drools/documentation.html
  • 35. 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 - Lightweight - Embedded - Generic - Extensible OMG Specification - Model, Notation, Execution - Understandable - Collaboration and Choreography Persistence (JPA, pluggable) - Runtime Persistence - History logging - Services Transactions (JTA, pluggable) - Command scoped - User-defined Domain-Specific processes - Extend palette with custom, declarative service nodes Human-Task Service (WS-HT) - Task Lists, Task Lifecycle Task Clients - Task form generation Web-based management - Targets Business Users Features - Manage process instances - User task lists / forms - Reporting - Manage process instances: start new process instances, inspect the state of currently running instances (status window and graphically) - Manage tasks: tasks assigned to human actors can be looked up and completed using task lists, and other task forms - Reporting: reports can be generated based on history information collected when executing processes. - Design: create/update your business process via graphical representation. - Test and Debug: test specific process scenarios and temporarily halt process executions to inspect their current state - Simulate: visualize process progress, manipulate the execution clock, send triggers, validate assertions at specific execution points, and more! - Design: create and update your business processes in the Web-based environment - Validate: validate your business processes visually. - Generate: generate fully executable process and task forms. Generate your process images and view your process in numerous formats. - Connect: connect to the jBPM Service Repository to install numerous domain-specific service nodes. - Migrate: migrate your existing jBPM 3 process definitions to BPMN2 with a single click.
  • 36. Guvnor – Decision Tables Types Limited Entry Body contains boolean states indicating
  • 37. which constraints or actions apply Extended Entry Body contains domain values Analysis Find errors and omissions Let Guvnor guide you Wizard to construct different types
  • 40. Guvnor - Templates Scaffolding for rules Quickly build similar rules
  • 41. Author structure with the guided rule editor
  • 43. Define values for variables Flexible authoring Keyboard or mouse navigation
  • 44. Keyboard or mouse multi-cell selection
  • 45. Copy and Paste or rows
  • 47. Column resizing Merging of cells Rapid authoring and maintenance Grouping of cells Hide areas whilst editing others
  • 48. Focus attention to sub-sections
  • 49. Guvnor – Decision Tables Flexible authoring Integration BRL columns Ultimate in flexibility
  • 50. Use BRL fragments in your decision table
  • 51. Mix and match with regular column types Use jBPM Work Items as actions Call your favourite jBPM Work Items
  • 52. Pass bound variables in Work Items
  • 53. Use Result Parameters to update Facts Keyboard or mouse navigation
  • 54. Keyboard or mouse multi-cell selection
  • 55. Copy and Paste or rows
  • 57. Column resizing Merging of cells Rapid authoring and maintenance Grouping of cells Hide areas whilst editing others
  • 58. Focus attention to sub-sections
  • 59. Guvnor UI Overview : Managing Assets: Asset Attribute View Save/Archive/Copy/Rename/Move/Validate assets.
  • 60. View and edit asset meta data
  • 61. Aset life cycle management
  • 64. Atom/Feed Asset Edit View Each asset type has its own editor to edit asset content. Managing Assets With Guvnor
  • 65. Managing Assets With Guvnor Managing Packages: Package assets list view: List all assets contained by the package based on asset types.
  • 66. Package Attribute View – Same as Asset Attribute View
  • 67. Package Edit View: Configure, build and deploy packages Managing Assets With Guvnor
  • 68. Guvnor for Drools and jBPM Guided Rule Editor Traditional applications fall short on flexibility: With the guided rule editor , users can read, write and redefine business rules themselves: With DSL , developers can build simple, readable rule pieces and users combine them as needed:
  • 69. QA - Testing & Verification Scenario Tests Test Scenarios are written by the rule authors to validate that the knowledge base is working.
  • 70. Scenario report shows the test coverage and the test statuses. Package Analysis Package analysis uses Drools rules to statically analyze knowledge modules.
  • 71. It produces a report that contains information about the quality of the knowledge module.
  • 72. Drools Planner Planning optimization for Java™ Every organization has planning problems, such as: Employee rostering
  • 76. Bin packing Yet, they hardly optimize those problems. Why? Because those problems are “NP-complete”: computationally very difficult and humanly impossible to optimize. Better planning algorithms reduce costs, improve service quality and help save the environment: Exam scheduling with Planner finds a feasible solution where common algorithms fail.
  • 77. Nurse rostering with Planner has on average 53% less unwanted shift assignments.
  • 78. Process allocation to computers with Planner has on average 28% less congested resources To confirm these numbers for yourself, download Planner and run the examples. A hospital can accommodate more patients when optimized with Drools Planner
  • 79. Community Information Download and Install Getting help (and helping out) Community, download & install info Events and up to date info
  • 83. Tips, Tricks & FAQ for users (rule developers)
  • 84. Patterns, best practices and guidelines
  • 85. Presentations slides and videos https://community.jboss.org/wiki/JBossRules https://www.jboss.org/drools/downloads As normal, the maniacs can be found in
  • 86. the drools IRC room at irc.codehaus.org.
  • 87. Web client available for those behind a firewall http://irc.codehaus.org 2 mailing list: &quot;user&quot; list for end user issues
  • 88. &quot;dev&quot; for questions about with the internals Jira to check existing issues and log yours is
  • 91. and sources in a single file
  • 92. Projects are available on both the central
  • 93. Maven repository and on the JBoss one
  • 94. Latest releases readily available including
  • 96. Drools plugin for Eclipse available for
  • 97. download as part of the Jboss Tools at http://www.jboss.org/tools/download.html or using the standard Eclipse Marketplace Client
  • 98. Branding Multi-Year Support The importance of Product and Project JBoss BRMS is the branded product offering from Red Hat; for which you can buy support subscriptions and professional services, such as training and on-site consultancy. JBoss itself is a Red Hat brand for it's Java middleware. JBoss BRMS is made up from a number of community projects - Drools Expert, Fusion, jBPM and Guvnor. Red Hat commits to supporting a product release over a large number of years, the length varies from product to product. Cumulative patch releases ensure you get the fixes without the risk of new features. And the assurance that we will be there for the long term. .org does not do maintenance releases it's a continuously forward moving R&D project. If you want the fixes you are going to get all the new features too, and the risks that come with them. Getting community support for previous .org releases can be hard, leaving you to the mercy of a volunteer based community. Multi-Year Support Sanity through Sanitization A common fear with OSS is due to the transparency of R&D. From casual inspection this can seem quite hairy as end users are exposed to all the unstable, unfinished and experimental works. This leaves a lot of uncertainty and fear in using OSS in a production environment. Closed source companies get to do all their R&D behind closed doors, and end users are only exposed and aware of the highly polished marketing. .com addresses this issue by removing or demarcating experimental or unstable features. To ensure there is a level of sanity and trust in what you are using. The product is typically 3 to 6 months behind in features, but offers strong levels of stability as a result. Direct Impact on Road Map Customers you have a direct line to influence roadmaps and bugs. Resources are prioritized for customers versus community jira's or mailing lists posts. It is also the only way to get Red Hat engineering resources of legacy releases, they will ignore .org legacy issues in the community. Community Independence By separating .org from .com it ensures that R&D can be bottom up user and community driven. This ensures a healthy eco system for ideas and innovation and collaboration - compared to a top down marketing driven model. The life cycle of .com and .org feeding into each other ensures the best of both worlds and help's maintain an important but delicate balance of innovation versus sanity and stability. I should add that .org is still relevant and important for .com customers as it provides an open environment for them to get involved and upstream their work, which may eventually end up in the product. Unburden R&D Everything that goes into ensuring a great product for the enterprise version entails a lot of work. You need a lot of resources that have meticulous attention to detail. Their priorities will be different to the R&D developers priorities. Stability and maintenance are the enemy of innovation. To ensure we have continued innovation at a project level it's important that we isolate R&D from these pressures. So everything about the product process is about freeing up the .org R&D developers so they can focus on ideas and innovations. Released products are tested across the range of JBoss and Red Hat products and also multiple versions. So if you are using JBoss BRMS you'll know it'll work on the range of AS services, or the JBoss SOA stack. We also check compatibility across other platforms such as Websphere and even IBM z/OS. .org. Community releases do not go through this compatibility matrix level of testing.