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

Debugging the right-hand side of a rule


As we already know, the right-hand side of a rule in Drools may contain a combination of the following elements:

  • Java sentences: Any regular Java sentence that is allowed in a Java method can also be used on the right-hand side of a rule in Drools.

  • MVEL expressions: If the dialect of the rule is set to mvel, MVEL expressions are enabled on the right-hand side of the rule in Drools.

  • Predefined variables and methods: Variables such as drools and kcontext and methods such as insert, update, and delete are also allowed. The special modify(){} structure could also be used on the right-hand side of the rule in Drools.

In the previous section, we introduced the notion of how, when compiled, the left-hand side of all the rules in a KIE Base is converted into a network of nodes. For the right-hand side of the rules, the situation is different. When a KIE Base is compiled, the right-hand side of each of the rules that it contains is converted into a Java class....