Book Image

Drools JBoss Rules 5.X Developer's Guide

By : Michal Bali
Book Image

Drools JBoss Rules 5.X Developer's Guide

By: Michal Bali

Overview of this book

<p>Writing business rules has always been a challenging task. Business rules tend to change often leading to a maintenance nightmare. This book shows you various ways to code your business rules using Drools, the open source Business Rules Management System.<br /><br />Drools JBoss Rules 5.X Developer's Guide shows various features of the Drools platform by walking the reader through several real-world examples. Each chapter elaborates on different aspects of the Drools platform. The reader will also learn about the inner workings of Drools and its implementation of the Rete algorithm.<br /><br />The book starts with explaining rule basics, then builds on this information by going through various areas like human readable rules, rules for validation, and stateful rules, using examples from the banking domain. A loan approval process example shows the use of the jBPM module. Parts of a banking fraud detection system are implemented with the Drools Fusion module which is the complex event processing part of Drools. Finally, more technical details are shown detailing the inner workings of Drools, the implementation of the ReteOO algorithm, indexing, node sharing, and partitioning.</p>
Table of Contents (22 chapters)
Drools JBoss Rules 5.X Developer's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Setting Up the Development Environment
Creating Custom Operators
Dependencies of Sample Application
Index

Spring framework integration


Drools, as of Version 5.1, provides out-of-the-box integration with the Spring framework. As we've seen in previous chapters, it comes with a custom drools-spring namespace, which is part of the drools-spring module. This section will be an overview of this namespace.

The drools-spring namespace allows us to define and configure knowledge bases, stateless and stateful sessions, listeners, groups of listeners, and custom accumulate functions including advanced features such as session persistency and others. See the Drools integration documentation for the full listing.

Furthermore, we can work with defined sessions through the command interface. Commands can be entered through the drools:batch element. These commands will then be performed on the session. We can set globals, insert facts, issue fire-all-rules call, start a process, or signal events.

An example XML file that uses the drools-spring namespace is explained in Code listing 11. It will create a validationKnowledgeBase...