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

Kie Base components


We have covered some of the most used components in a knowledge base, such as rules, globals, queries, and channels. It is time to move on to more advanced topics that will allow us to create more concise and reusable knowledge.

In this section, we are going to cover topics such as functions, custom operators, and custom accumulate functions. All these components can be used to model our knowledge in a simpler yet powerful way.

Functions

So far, we have covered three of the most common knowledge declarations that we have in Drools: rules, queries, and declared types. There is another kind of knowledge declaration that can be used to express stateless logic in a knowledge base: functions. Functions in Drools are basically isolated pieces of code that will optionally take arguments and may or may not return a value. Functions are useful for situations where we want to define some logic in a knowledge base instead of having it, for example, in an external Java class.

The syntax...