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

KieModule configurations (KieBases, KieSessions & StatelessKieSessions)


The kmodule.xml file is used to customize the KieModule configurations. In this file, we can define how the rules are grouped together in different KieBases that can be loaded for different purposes. It also allows us to define more fine-grained configurations for the rule engine instance that will be created.

In this section, we will cover the basic configurations for KieBases, KieSessions, and StatelessKieSessions. In the end, we will also review a mechanism that we can use to include other KieBases from other KieModules in our KieModule.

Let's start simple with the kmodule.xml file defined in the chapter-03-classpath-tests/src/test/resources/META-INF/ directory, as follows:

<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://jboss.org/kie/6.0.0/kmodule">
    <kbase name="rules.cp.discount">
        <ksession name="rules...