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

Understanding the Drools runtime instances


Drools allows us to create instances of the Rule Engine in different ways, so that we can choose which fits better to the problem that we are trying to solve. Each Rule Engine instance is an encapsulated context, where the rules that we define will be evaluated against the data that we provide to this particular instance. Historically, Rule Engines were seen as big and monolithic processes that run them in a server and we can send data to it to be processed. Drools, on the other hand, allows us to locally spawn lightweight instances to our application. It is common to have multiple instances dealing with different rules and data than just one big instance.

In order to spawn a new instance of the rule engine, we need to understand the following concepts:

  • KieServices

  • KieContainer

  • KieModule

  • KieBase

  • KieSession

By using these five concepts, we will be able to define how each instance is configured and rules that will be available to each of them. In cases where...