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

Decorating our objects in memory


We've seen examples where we modify the working memory whenever we detect that a specific condition is happening. We might remove objects, modify existing ones, and even delete them to trigger other rule executions. We've also seen that, sometimes, these elements make sense mostly within the rule executions and used declared types for these cases.

Whether we use declared types of external classes, most of the cases imply one of the following two strategies:

  • We add new objects (declared types or Java classes) to the working memory, representing some inference about our domain model

  • We modify attributes of existing objects in the working memory, adding the inferred data to these properties

These strategies have a few disadvantages when it comes to decorating an existing model. The first case (adding new objects) might imply having to keep a reference between the domain model object and the new inferred object in some form. The second case (modifying attributes...