Book Image

Mastering JBoss Drools 6

By : Mariano De Maio, Mauricio Salatino, Esteban Aliverti
Book Image

Mastering JBoss Drools 6

By: Mariano De Maio, Mauricio Salatino, Esteban Aliverti

Overview of this book

Mastering JBoss Drools 6 will provide you with the knowledge to develop applications involving complex scenarios. You will learn how to use KIE modules to create and execute Business Rules, and how the PHREAK algorithm internally works to drive the Rule Engine decisions. This book will also cover the relationship between Drools and jBPM, which allows you to enrich your applications by using Business Processes. You will be briefly introduced to the concept of complex event processing (Drools CEP) where you will learn how to aggregate and correlate your data based on temporal conditions. You will also learn how to define rules using domain-specific languages, such as spreadsheets, database entries, PMML, and more. Towards the end, this book will take you through the integration of Drools with the Spring and Camel frameworks for more complex applications.
Table of Contents (18 chapters)
Mastering JBoss Drools 6
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

PHREAK improvements over RETE


Most of the topics introduced so far in this chapter are not exclusive to the PHREAK algorithm. And this is not really a surprise; after all, the PHREAK algorithm is an evolution of the RETE algorithm implementation from previous versions of Drools (RETEOO). Even if both algorithms have a lot in common, PHREAK introduces some interesting modifications in the way the network of nodes is evaluated. Let's cover the most important improvements of PHREAK over RETEOO.

Delayed rule evaluation

When the PHREAK engine is started, all the rules are said to be unlinked. An unlinked rule is never going to be evaluated by Drools. When the insert, update, and/or delete actions modify the state of a KIE Session, the modification is only propagated up to the alpha sub-network and queued before it enters the beta sub-network. Unlike RETEOO, in PHREAK no Beta Node is then evaluated as a consequence of any of these operations. A heuristic determines which rule is the most likely...