JBoss Rules Reference Guide

JBoss Enterprise SOA Platform 4.3

JBoss Rules Reference Guide

Your guide to using JBoss Rules with the JBoss Enterprise SOA Platform 4.3

Edition 1.0


Legal Notice

Copyright © 2008 Red Hat, Inc.. This material may only be distributed subject to the terms and conditions set forth in the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License (which is presently available at http://creativecommons.org/licenses/by-nc-sa/3.0/).

Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries.

All other trademarks referenced herein are the property of their respective owners.

The GPG fingerprint of the security@redhat.com key is:

CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E


1801 Varsity Drive
RaleighNC 27606-2072USAPhone: +1 919 754 3700
Phone: 888 733 4281
Fax: +1 919 754 3701
PO Box 13588Research Triangle ParkNC 27709USA

September, 2008

Abstract

This book is the SOA Platform edition of the JBoss Rules Reference Manual


Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. We Need Feedback!
1. JBoss Rules 4.0.7 Release Notes
1.1. What is new in Drools 4.0
1.1.1. Language Expressiveness Enhancements
1.1.2. Core Engine Enhancements
1.1.3. IDE Enhancements
1.1.4. Miscellaneous Enhancements
1.2. Upgrade tips from Drools 3.0.x to Drools 4.0.x
1.2.1. API changes
1.2.2. Rule Language Changes
1.2.3. Drools Update Tool
1.2.4. DSL Grammars in Drools 4.0
1.2.5. Rule flow Update for 4.0.2
2. The Rule Engine
2.1. What is a Rule Engine?
2.1.1. Introduction and Background
2.2. Why use a Rule Engine?
2.2.1. Advantages of a Rule Engine
2.2.2. When should you use a Rule Engine?
2.2.3. When not to use a Rule Engine
2.2.4. Scripting or Process Engines
2.2.5. Strong and Loose Coupling
2.3. Knowledge Representation
2.3.1. First Order Logic
2.4. Rete Algorithm
2.5. The Drools Rule Engine
2.5.1. Overview
2.5.2. Authoring
2.5.3. RuleBase
2.5.4. WorkingMemory and Stateful/Stateless Sessions
2.5.5. StatefulSession
2.5.6. Stateless Session
2.5.7. Agenda
2.5.8. Truth Maintenance with Logical Objects
2.5.9. Event Model
2.5.10. Sequential Mode
3. Decision Tables
3.1. Decision tables in spreadsheets
3.1.1. When to use Decision tables
3.1.2. Overview
3.1.3. How decision tables work
3.1.4. Keywords and syntax
3.1.5. Creating and integrating Spreadsheet based Decision Tables
3.1.6. Managing business rules in decision tables.
4. The (Eclipse based) Rule IDE
4.1. Introduction
4.1.1. Features outline
4.1.2. Creating a Rule project
4.1.3. Creating a new rule and wizards
4.1.4. Textual rule editor
4.1.5. Guided editor (rule GUI)
4.1.6. Views
4.1.7. Domain Specific Languages
4.1.8. The Rete View
4.1.9. Large drl files
4.1.10. Debugging rules
5. The Rule Language
5.1. Overview
5.1.1. A rule file
5.1.2. What makes a rule
5.1.3. Reserved words
5.2. Comments
5.2.1. Single line comment
5.2.2. Multi line comment
5.3. Package
5.3.1. import
5.3.2. expander
5.3.3. global
5.4. Function
5.5. Rule
5.5.1. Rule Attributes
5.5.2. Left Hand Side (when) Conditional Elements
5.5.3. The Right Hand Side (then)
5.5.4. A note on auto boxing/unboxing and primitive types
5.6. Query
5.7. Domain Specific Languages
5.7.1. When to use a DSL
5.7.2. Editing and managing a DSL
5.7.3. Using a DSL in your rules
5.7.4. Adding constraints to facts
5.7.5. How it works
5.7.6. Creating a DSL from scratch
5.7.7. Scope and keywords
5.7.8. DSLs in the IDE
5.8. Rule Flow
5.8.1. Assigning rules to a ruleflow group
5.8.2. A simple ruleflow
5.8.3. How to build a rule flow
5.8.4. Using a rule flow in your application
5.8.5. Different types of nodes in a ruleflow
5.9. XML Rule Language
5.9.1. When to use XML
5.9.2. The XML format
5.9.3. Legacy Drools 2.x XML rule format
5.9.4. Automatic transforming between formats (XML and DRL)
6. Deployment and Testing
6.1. Deployment options
6.1.1. Deployment using drl source
6.1.2. Deploying rules in your classpath
6.1.3. Deployable objects, RuleBase, Package etc.
6.1.4. Deployment patterns
6.1.5. Web Services
6.1.6. Future considerations
6.2. Testing
6.2.1. Testing frameworks
6.2.2. FIT for Rules - a rule testing framework
7. The Java Rule Engine API
7.1. Introduction
7.2. How To Use
7.2.1. Building and Registering RuleExecutionSets
7.2.2. Using Stateful and Stateless RuleSessions
7.3. References
A. Revision History
Index