Red Hat's open source rule engine turns full-goose enterprise BRMS, and decision management suite, in Version 5.0 Bottom LineJBoss Drools 5.0 adds several new features, such as workflow, constraint programming, and event programming, all of which significantly boost its usefulness as a decision management toolkit. However, it lacks support for common mechanisms for enterprise integration, such as JCA, WS-*, or JMS, as well as a strategy for SOA, such as registering rules as services.Red Hat’s JBoss Drools 5.0 — and its commercial counterpart, JBoss Enterprise BRMS 5.0 — is a suite of applications that Red Hat refers to as a Business Logic integration Platform. It encompasses the traditional BRMS (business rule management system) functionality of Drools 4.0 and adds BPM (workflow), a constraint solver module, an improved Web-based interface for business users to manage rules, and support for event and temporal rule processing. Developing an application suite of this breadth is a tall order. BPM (workflow) and BRMS are related but separate technologies, and despite the technical elegance of an integrated solution, a great deal of tooling surrounds each. It’s not a trivial exercise to reproduce either toolset, much less pull them together. Other parts of the Drools suite, such as Solver, Fusion, and Guvnor (BRMS) make a great match, and I’m unaware of any other suites bringing these three technologies under one umbrella.Drools is no longer a simple rules engine, but an application suite. The original rules engine has been renamed Expert and still underpins much of the suite’s functionality. Fusion is an enhancement to the rules engine allowing one to write rules about events that occur over time. Flow implements BPM capabilities. Guvnor is the new Web-based rule editor and testing application. Finally there is Solver, an optimization module. More details on each of these follow. Expert Expert, the rules engine core, received several improvements. First, shadow facts, a mechanism required to keep the engine’s internal view of the world consistent with the view from the JVM, have been eliminated, reducing complexity and developer workload. (Previously, without shadow facts, if an object in the JVM were to modify a fact in working memory and fail to tell the rule engine, the rules depending on that fact would not be fired.) The ability to dynamically declare facts at runtime makes it easier to write rules and allows for the definition of Business Object Models via XML schemas (XSD).Also new is the ability to efficiently serialize working memory sessions, important when managing long-running stateful sessions, such as those often seen in applications of Fusion (covered next). Domain-specific languages (DSLs) also see minor improvements.These features extend the stable and proven 4.x core rules engine. The API has been refactored to support the remainder of the suite and to further isolate developers from the engine’s internal details. The refactoring also cleans up a few inconsistencies and makes the API a bit more coherent. While extensive, the changes should not present a challenge to any developer familiar with Version 4.0, and backward compatibility is maintained. Another welcome improvement is the ability to have multiple runtimes in the Eclipse interface, allowing developers to maintain legacy 4.x projects, while simultaneously working with projects using 5.x runtime JARs. Performance of the engine is slightly slower than with Version 4.0, likely a result of the rule compiler and API refactoring. This will probably improve in subsequent versions, and the differences in speed are minor.The new Guvnor is a browser-based application that allows business users to author, update, and test changes to business rules. Scenarios (shown here) allow regression testing of proposed changes. FusionFusion is an extension to the rules engine that allows writing about events that occur over time. Take this rule, for example: StockTick( symbol == "IBM" ) over window:time( 60s )It filters the working memory for any StockTicks for IBM over the last 60 seconds, which would be difficult to write using traditional rules engines due to a lack of infrastructure for accessing clocks and expiring facts when they no longer match rules. Thus, they quickly run out of memory when trying to process such a rule.This type of reasoning is often referred to as Complex Event Processing (CEP), although there is more to processing and correlating events than time components. CEP is a relatively new branch of applied artificial intelligence, and it’s one of the most exciting new features in Drools 5.0. Unlike some competing commercial products in this space, which lack commonly used operators such as “not” and “exists,” Fusion fully implements all first-order logic operators. Sadly, support for persistence of working memory, a requirement for long-running time windows and high availability, did not make it into Drools 5.0. FlowA significant percentage of the work in Drools 5.0 went into the enhancements to the simple rule flow for orchestrating rules found in Version 4.0. The Flow module, an integrated environment for both rules and processes, is in many ways the central component of the suite, where rules, events, and process orchestration are unified.The idea of an integrated environment to manage rules, processes, and business events is an appealing one. Good decision models use all three, and there are several more or less accepted standards for modeling and executing business processes. Unfortunately, Flow does not adhere to any of them — neither BPMN for process modeling, nor BPEL for execution on existing process engines. This is partly because the ideas developed in this version can’t be adequately expressed in existing standards and partly due to the size of the task. There is some support for WS-HT (human tasks) semantics, but none for the Web services endpoints, so integration again becomes an issue. GuvnorGuvnor is a business-friendly front end for managing the business rules of an organization. This version is a nearly complete overhaul of the old BRMS component of Drools 4.0. It includes a deployment manager, fine-grained access control (with integration to LDAP repositories), integration with the Eclipse developer rule environment (via an Eclipse plug-in), WebDAV, and the ability to automatically run regression tests over rules, Web-based decision tables, and more. Guvnor makes use of the Apache Jackrabbit repository, so high availability and version control are possible through this JCR-170 storage mechanism.Although feature complete, the user interface has clearly not received the spit and polish that commercial vendors have. It has the look and feel given to many applications by engineers, with usability taking a backseat to functionality. Decision tables, which lack the ability to span cells, could also stand some improvement. Generally, though, this module is a good foundation to build a customized rule management interface aimed at business users. SolverSolver is a constraint optimization module for solving large planning problems. Its main competitor in the open source arena is CPSolver. Planning problems are typical in such areas as supply chain management and scheduling. Solver is unique in its use of the rules engine for expressing constraints. One consequence of this is the efficiency and expressiveness in which constraints can be defined. Constraints — both hard and soft — are defined as rules and executed accordingly.Optimization problems are primarily found in operational research domains, a complex and highly technical topic that can’t be covered here except to say that Solver implements what is known as local search, seeking out optimal solutions by assigning variables close to a previous guess. Heuristic techniques are sometimes required to prevent the search from getting stuck on a local minimum, maximum, or plateau. Solver excels in the adding and editing of constraints, using easily understood rules, so the definition of the search domain is greatly simplified. [ IBM/Ilog’s JRules 6.5 brought rules to SOA. See the InfoWorld Test Center review. | Fair Isaac’s Blaze Advisor 6.5 nabbed InfoWorld’s 2008 Technology of the Year Award for Best Business Rule Management System. See the Test Center review. ]The integration of optimization, analytics, and business rules is an interesting trend in enterprises with high transaction volumes or a high degree of customer interaction, such as retail banking or telecommunications. I’ve only scratched the surface of Solver; a complete discussion of its applications could be the subject of an entire article itself, but I look forward to the next few versions of this module and its further integration in the core rules engine. Further baking required JBoss Drools 5.0 adds a significant number of new capabilities over Version 4.0, but while the breadth of the product offering is considerably enhanced, the product suite still lacks depth in key areas required for enterprise-scale deployments.The rule execution server is rudimentary and does not support key open standards in Web services required for SOA implementations, such as those for reliable messaging, security, or transactions. The server also lacks support for monitoring (such as JMX), scalability, or integration (such as JCA).The story isn’t much better for the workflow component. Although the idea of a unified platform for events, rules, and processes is technically elegant and appealing, it may be ahead of its time. Partly as a result of some of the advanced capabilities being trailed in this version, where no standards exist, the workflow component supports neither BPMN nor BPEL, two common standards in BPM today. Overall, JBoss Drools 5.0 (and JBoss Enterprise BRMS) brings a number of new capabilities under the product’s umbrella, but the cake isn’t quite done. This may be expected for such a large, ambitious project. For the moment, organizations with strong Java capabilities and a commitment to developing and supporting their own applications will find a stable, mature rules engine from Drools 4.0, and a new BRMS with many useful new tools.If you’re currently running Drools 4.0, then 5.0 will likely work out of the box, and is a recommended upgrade. For organizations with Java skills and a willingness to roll your own integration and reliability layers, Drools provides a great platform on which to start. If that’s not your organization, then IBM/Ilog’s JRules and Fair Isaac’s Blaze Advisor are still top choices.JBoss Drools 5.0 ProsIntegrated technology stack for decision-making: CEP, rules, and constraint programming under a single umbrella. Active and supportive user community. Access to core developers, bug lists, and status of code issues. Low cost of entry and potentially high ROI.ConsLacks support for key Web services standards. Lacks critical components for reliable, scalable, and secure execution of business rules in an enterprise environment.CostJBoss Drools 5.0 is available as free open source under the Apache License 2.0. JBoss Enterprise BRMS 5.0 subscriptions, which include Drools, Guvnor, Web 2.0 rule authoring interfaces for business analysts, and maintenance and support, start at $20,000 per year for a four-socket deployment.PlatformsAll Java 1.5+ platforms Software Development