Free Sample
+ Collection

Drools JBoss Rules 5.0 Developer's Guide

Michal Bali

As a Java developer, you can make life a lot easier by using Drools to implement business rules. This book shows you how with clear instructions across the whole range of efficiencies the platform provides.
RRP $29.99
RRP $49.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781847195647
Paperback320 pages

About This Book

  • Discover the power of Drools as a platform for developing business rules
  • Build a custom engine to provide real-time capability and reduce the complexity in implementing rules
  • Explore Drools modules such as Drools Expert, Drools Fusion, and Drools Flow, which adds event processing capabilities to the platform
  • Execute intelligent business logic with ease using JBoss/Drools, a stronger business-rules solution
  • Covers examples of a fraud detection system utilizing Drools CEP (Complex Event Processing) capabilities

Who This Book Is For

The book is for Java developers who want to create rules-based business logic using the Drools platform. Basic knowledge of Java is essential.

Table of Contents

Chapter 1: Introduction
Problems with traditional approaches
The solution
Alternatives to Drools
Chapter 2: Basic Rules
Rule basics
Rule syntax
Chapter 3: Validation
Banking domain model
Problem definition
Validation package
Validation service
Chapter 4: Data Transformation
Process overview
Getting the data
Writing transformation rules
Transformation results
Implementation of the data loading
Chapter 5: Human-readable Rules
Domain Specific Language
Decision tables
Drools Flow
Chapter 6: Stateful Session
Introduction to stateful session
Validation using stateful session
Chapter 7: Complex Event Processing
Drools Fusion
Fraud detection
Chapter 8: Drools Flow
Loan approval service
Loan approval ruleflow
Chapter 9: Sample Application
Technologies used
Business logic
Loan approval
Chapter 10: Testing
How to write unit tests for rules
Rule integration testing
Rule acceptance testing
Static analysis of rules
Troubleshooting techniques
Chapter 11: Integration
Dynamic KnowledgeBase loading
External artifact building
Drools execution server
Spring Framework integration
Chapter 12: Performance
Rete algorithm
Node sharing
Node indexing
KnowledgeBase partitioning

What You Will Learn

  • Write more efficient business rules, and work with the Rete algorithm, node indexing, node sharing, and parallelization
  • Create a WS-HumanTask-compliant WorkItem in a process (workflow)
  • Implement concurrency control in cross-cutting functionalities to manage code easily
  • Write human-readable rules, and Domain Specific Language for your rules to easily understand and verify them
  • Generate a stateful service by using a stateful knowledge session that maintains state between invocations and teaches you how to transactionally persist this service
  • Develop dynamic remote knowledge-base loading to change rules in your application without even stopping it
  • Prepare decision tables for calculating account interest rates
  • Integrate Drools within your Java business application, and integrate it with the Spring framework

In Detail

Business rules can help your business by providing a level of agility and flexibility. As a developer, you will be largely responsible for implementing these business rules effectively, but implementing them systematically can often be difficult due to their complexity. Drools, or JBoss Rules, makes the process of implementing these rules quicker and handles the complexity, making your life a lot easier!

This book guides you through all of the features of Drools, such as dynamic rules, the event model, and Rete implementation with high performance indexing. It will help you to set up the JBoss Rules platform and start creating your own business. It's easy to start developing with Drools if you follow its real-world examples that are intended to make your life easier.

Starting with an introduction to the basic syntax that is essential for writing rules, the book will guide you through validation and human-readable rules that define, maintain, and support your business agility. As a developer, you will be expected to represent policies, procedures and. constraints regarding how an enterprise conducts its business; this book makes it easier by showing you it can be done.

A real-life example of a banking domain allows you to see how the internal workings of the rules engine operate. A loan approval process example shows the use of the Drools Flow module. Parts of a banking fraud detection system are implemented with Drools Fusion module, which is the Complex Event Processing part of Drools. This in turn, will help developers to work on preventing fraudulent users from accessing systems in an illegal way.

Finally, more technical details are shown on the inner workings of Drools, the implementation of the ReteOO algorithm, indexing, node sharing, and partitioning.


Read More