Skip to: Site menu | Main content

Drools

Java Rules Engine

Release Notes Print

2.5 final

Drools 2.5 Release Notes

New and noteworthy

Drools 2.5 contains a mouthful of fixes and enhancements, mostly evolutionary. One big change is the use of Apache JCI as the compiler interface for Java and Groovy semantics (and using Eclipse JDT as the runtime Java semantic compiler by default). This is a key milestone on the way to Drools 3.

There are some performance enhancements, and there has been excellent support from the community in nailing down bugs, issues and providing fixes and enhancements.

Quick start

For those impatient to get going, here is a really quick guide to get you going (there have been some dependency changes for Drools 2.5).

Drools lib

  • Download the whole shebang, drools-2.5-final-bin-withdeps.zip from the download page
  • Inside this you will find drools-all-jdk5-2.5-final.jar (works with 1.4 !) - which is ALL the drools modules together (you may be able to trim this down later, if you like, depending on your needs)

3rd party dependencies (from the zip above)

  • antlr-2.7.5.jar
  • asm-1.5.3.jar
  • cglib-2.1.jar
  • commons-jci-SNAPSHOT20051110.jar
  • commons-logging-1.0.4.jar
  • jdtcore-3.1.0.jar

The above is for java semantics, enough to get you going. If you wish to use python, groovy etc, you will of course need the appropriate jars (but everything you need is in that zip).

Drools is highly modular, so you may find you can strip down your dependencies (or bulk them up !) a lot for your specific project. People have varying needs, and it is rare that anyone needs all the functionality in drools. It spans from python to groovy to spring, so you can understand that the "possible" dependency list will be quite long if you use all the functionality.

Release Notes - drools - Version 2.5

Bug

  • DROOLS-430 - xor-group directive seems to be ignored
  • DROOLS-446 - Performance degradation due to PrimitiveLongMap
  • DROOLS-463 - Performance problem when using JNDI binding for serialization
  • DROOLS-468 - Make rulebase efficiently serializable
  • DROOLS-469 - Create new ReteDumper so people do not access Dumper in reteoo directly
  • DROOLS-470 - condition ending with ; is not considered as wrong when parsing ruleset but generates error when asserting an object
  • DROOLS-471 - The method setLocator in RuleSetReader should actually be setDocumentLocator
  • DROOLS-474 - HelloWorld example not working
  • DROOLS-475 - Decision tables throw an error if a data cell has a $ in it.
  • DROOLS-481 - JavaSemanticCompileError should report error message from the compiler
  • DROOLS-482 - JCI jar must be updated for JDK1.4 friendly version

Improvement

  • DROOLS-432 - Functions should not be semantic aware
  • DROOLS-433 - Rename SemanticComponent as RuleComponent
  • DROOLS-436 - Make Python components implement SemanticComponent
  • DROOLS-441 - RuleBaseLoader should now create RuleBases from URL[] or RuleSetPackage[]
  • DROOLS-451 - Move to in Memory JCI implementation
  • DROOLS-452 - Refactor RuleBaseLaoder and general DRL loading and Deployment mechanisms
  • DROOLS-453 - Update to xerces 2.7.1 and xml-api 2.0.2
  • DROOLS-454 - Update to janino 2.3.15
  • DROOLS-455 - Update groovy to groovy-all-1.0-jsr-04.jar
  • DROOLS-457 - Update to poi 2.5.1
  • DROOLS-458 - Provide legacy API compatability for RuleBaseLoader
  • DROOLS-459 - SAXException is not JDK1.4 nested exception aware
  • DROOLS-466 - Custom entity resolver support for RuleSetReader
  • DROOLS-473 - Make source for Drools-IDE 1.4 compliant
  • DROOLS-483 - Excel formula support: contributions from Pascal Chanteux

New Feature

  • DROOLS-424 - Add no-loop, xor-group support (and more) to decision table parser contributions from Felipe Piccolini (Bluesoft)
  • DROOLS-434 - Create semantic interfaces to support compilable ruleset and rule components
  • DROOLS-435 - Create a RuleCompiler
  • DROOLS-437 - Move drools-java to the new Semantic Compiler interfaces
  • DROOLS-438 - Create classes implementing the Semantic Compiler interfaces that work with JCI and Eclipse JDT
  • DROOLS-439 - Create a RuleSetCompiler
  • DROOLS-440 - Create a RuleSetLoader
  • DROOLS-443 - Create classes implementing the Semantic Compiler interfaces that work with the Groovy Compiler
  • DROOLS-447 - Initial C# implementation
  • DROOLS-448 - Add NAnt build file to C# module
  • DROOLS-467 - compiled rules to load from byte[]

Task

  • DROOLS-449 - Confluence Documentation
  • DROOLS-450 - Build tidy up

2.1 final

Drools 2.1 Release Notes

New and Noteworthy

Decision Tables

Decision tables are a "precise yet compact" (ref. Wikipedia) way of representing conditional logic, and are well suited to "business" level rules.

Uses Excel files as the input source for business rules (Open Office is also suitable for this) - effectively creating a business user friendly front end to drools.

Refer to Decision Tables

Spring Integration (beta)

Three new spring related modules have been added for 2.1: drools-spring, drools-spring-jdk5, and drools-spring-examples. These are intended to eventually replace drools-annotation and provide much deeper spring integration. The code is very functional and has been used in a production system for some months now, but the docs are very minimal, hence the beta status.

If you decide to use these modules, have a look at the HVAC example and the partial tutorial|http://docs.codehaus.org/display/DROOLS/Drools+Spring+Tutorial] based on the HVAC example. And of course feel free to post on the mailing list with any issues that you encounter.

Xor Group

Drools now supports xor groups. Xor groups allow only a single rule within a group to fire, all other rules in that group are then removed from the agenda. A rule can be in only a single xor group.

  <rule name="test rule" xor-group="group" >
  ...

JDK 1.4

Drools is now JDK 1.4 and JDK 5 compatible, we have dropped support for JDK1.3. This allows us to now use nested exceptions which makes exception handling easier in Drools.

SynchronizedWorkingMemory

The WorkingMemory instance returned from a RuleBase is now completely unsychronized. We now supply a synchronized delegate class SynchronizedWorkingMemory that can be used to add synchronized capalities.

WorkingMemory workingMemory = new SynchronizedWorkingMemory( ruleBase.newWorkingMemory( ) );

ChangeLog

  • Bug
    • DROOLS-294 - WorkingMemory synchronization is not complete (Barry Kaplan)
    • DROOLS-314 - MethodMetadataSource's need a stopping Class (Barry Kaplan)
    • DROOLS-318 - WorkingMemoryEventListenerProcessor implements wrong interface (Barry Kaplan)
    • DROOLS-347 - Maven build of drools-spring-jdk5 fails on Mac OS X (Andy Barnett)
    • DROOLS-367 - Wrong rule executed when modifying object in workingmemory (Michael Neale)
    • DROOLS-374 - Caching of classloaders in causes problems with hot deployment in some J2EE containers (Michael Neale)
    • DROOLS-376 - Make source file (c) headers consistent with codehaus (Michael Neale)
    • DROOLS-386 - Bug with the Escalation example? (Robert Laflamme)
    • DROOLS-401 - Missing semaphore types in schema file (rules.xsd) (Edson Tirelli)
    • DROOLS-403 - no-loop incorrectly removes all instances of a rule from the agenda (Michael Neale)
    • DROOLS-409 - rename getNoLoop to isNoLoop to obey JavaBean naming convention (Mark Proctor)
  • New Feature
    • DROOLS-303 - Default rule-method parameter annotation (Barry Kaplan)
    • DROOLS-360 - Maven goal for drools-all-src-XXX.zip (Mark Proctor)
    • DROOLS-361 - Auto add RuleSet to RuleBase (Barry Kaplan)
    • DROOLS-363 - Decision tables in spreadsheets (Michael Neale)
    • DROOLS-383 - Integrate java:functions feature in decision tables. (Michael Neale)
    • DROOLS-388 - Support for application data (variables), per rule duration, salience and names (Ricardo Rojas)
    • DROOLS-408 - Xor Group so only one rule can fire for a specific group (Mark Proctor)
  • Improvement
    • DROOLS-296 - Allow for default id value in parameter annotations (Barry Kaplan)
    • DROOLS-297 - Allow multiple consequence annotations per rule (Barry Kaplan)
    • DROOLS-301 - Remove 'Drools' prefix from annotations (Barry Kaplan)
    • DROOLS-309 - MethodMetadataSource to ignore certain classes (Barry Kaplan)
    • DROOLS-310 - Condition sharing for POJO rules (Peter Royal)
    • DROOLS-348 - JDK 1.3 no longer supported (Barry Kaplan)
    • DROOLS-350 - Utilize 1.4 nested exceptions (Barry Kaplan)
    • DROOLS-357 - Packaging between factory and meta needs some attention (Barry Kaplan)
    • DROOLS-364 - Update spring libs and config files for 1.2 (Barry Kaplan)
    • DROOLS-372 - Update Groovy to JSR-03 (Mark Proctor)
    • DROOLS-381 - Add object-condition tests to RuleBuilderTest (Barry Kaplan)
    • DROOLS-387 - add ability for a DSL to acces the XML namespace information in a Configuration (James Strachan)
    • DROOLS-402 - Refactor maven.xml and drools:dist to make it faster and more intelligent (Mark Proctor)
    • DROOLS-410 - Update Janino to 2.3.8 (Mark Proctor)
  • Test
    • DROOLS-346 - Ant build.xml doesn't run drools-jsr94 unit tests (Andy Barnett)
  • Task
    • DROOLS-351 - Remove drools-annotation and derivitives from 2.1 (Barry Kaplan)
    • DROOLS-370 - Add in drools-decisiontables subproject (Michael Neale)

2.0 final

Release Overview

Small updates to documentation, nothing else.

ChangeLog Highlights:

  • Task
    • DROOLS-89 - Update docs on SMF module (Mark Proctor)
    • DROOLS-91 - Document Python Semantics Module (Mark Proctor)

2.0-rc2

Release Overview

Minor tidyup changes to the build environment and some small improvements to the exception swallowing.

ChangeLog Highlights:

  • Improvement
    • DROOLS-349 - Compile problems are "swallowed" by drools (Mark Proctor)
    • DROOLS-353 - Cleanup Maven build (Mark Proctor)

2.0-rc1

Release Overview

I'm particularly proud of this release, not just because of the large number of fixes and enhancements that make Drools better than ever but because of the momentum Drools is finally gaining with contributions from the community, you will see many new names in the ChangeLog Highlights which I list below, in no partciular order:

  • Barry Kaplan
  • Jeff Brown
  • Philip Smith
  • Kdx
  • Geoffrey Wiseman
  • Edson Tirelli

So a big thank you to all of the above, and of course to the rest of our community who regularly test drools and submit bug reports.

Of course there is also need for celebration as this is the first release candidate for drools, that means the code is now in feature freeze. We hope to do one more release candidate in 2-3 weeks and then a final 2-3 weeks after that. The documentation effort will continue throughout this time.

New and Noteworthy

The biggest highlight in this release is Jeff Brown's "Conway's Game of Life Example". The example uses JGoodies to create a graphical representation of this old favourite, it illustrates the use of drools-java for standard java business rules and also the use of Domain Specific Language.

<java:import>, <python:import> and <groovy:import> have been deprecated for <import>, but like <xxx:class> was deprecated many releases ago we will continue to support the notation for the 2.0 release.

We now have a complete ANT build script, so you can compile all of Drools and run the examples without Maven. It should be noted that the build environments use the same directory structures; this means you can build with Ant and run examples with Maven and vice-versa.

ChangeLog Highlights:

  • Bug
    • DROOLS-259 - Add support for robust classLoader handling (Mark Proctor)
    • DROOLS-260 - <java:functions> doesn't see <java:import>-ed classes (kdx)
    • DROOLS-291 - Condition does not compile (Bob Mcwhirter)
    • DROOLS-292 - No warning when bean does not implement addPropertyChangeListener (Barry Kaplan)
    • DROOLS-299 - org.xml.sax.SAXParseException: <parameter> has an invalid parent (Mark Proctor)
    • DROOLS-305 - Invalid Handles after calling retractObject in WorkingMemory (Mark Proctor)
    • DROOLS-306 - drools-all produces error (Mark Proctor)
    • DROOLS-307 - Remove drools-annotation from drools-all (Mark Proctor)
    • DROOLS-313 - Import statements might cause the Rete network to be build erroneously (Edson Tirelli)
    • DROOLS-323 - Serialized Rule Bases seems to lose functions (Mark Proctor)
    • DROOLS-324 - iterator IllegalStateException on firing a temporal rule (Philip Smith)
    • DROOLS-329 - Correction to Handler logic in RuleSetReader (Mark Proctor)
    • DROOLS-336 - Detect ambiguously defined classes (kdx)
    • DROOLS-342 - Fix serialization for python and groovy (Mark Proctor)
  • Improvement
    • DROOLS-325 - Improved Application Data Error Message (Geoffrey Wiseman)
    • DROOLS-328 - Upgrade to janino-2.3.2 (Mark Proctor)
    • DROOLS-333 - Update to groovy 1.0-jsr-01 (Mark Proctor)
    • DROOLS-334 - Make Clover work from maven (Mark Proctor)
    • DROOLS-337 - Update to antrl 2.7.5 (Mark Proctor)
    • DROOLS-340 - Turn off warning for jaxp1.2 compliancy (Mark Proctor)
    • DROOLS-341 - Centralise Import code and provide some level of caching (Mark Proctor)
    • DROOLS-343 - Added unit test for the Semaphore implementation (Mark Proctor)
    • DROOLS-344 - Add Conway's "Game of Life" example (Jeff Brown)
    • DROOLS-345 - Deprecate <smf:import> in favour of <import> (Mark Proctor)
    • DROOLS-100 - Ant Build File (Mark Proctor)
    • DROOLS-261 - <java:functions> should also let inner classes work (kdx)
  • Task
    • DROOLS-227 - Document Ant Build Environment (Mark Proctor)

2.0-BETA-21

Release Overview

This is hopefully the last beta for Drools before we release a RC, assuming no ugly bugs rear their heads. We are very excited with new member Barry Kaplan's addition of POJO rules to Drools via JDK1.5 annotations. A domain specific language example has finally been written showing of the extensability of the SMF. We now allow pre JAXP1.2 parsers, which turns schema validation off, so warnings are not produced. Lastly modify has been profiled and optimised; it now follows the other systems out there in doing a retract and assert for a modify.

New and Noteworthy

Java Annotation Semantic Module (Barry Kaplan)

This beta introduces the [Java Annoation Semantic Module], allowing rules to be specified using Java 5 annotations.

@DroolsRule
public class FloorTooColdPumpOff
{
    @DroolsCondition
    public boolean isTooCold(@DroolsParameter("thermometer") Thermometer thermometer,
                             @DroolsParameter("control") TempuratureControl control) {
        return control.isTooCold(thermometer.getReading());
    }
    
    @DroolsCondition
    public boolean isPumpOff(@DroolsParameter("pump") HeatPump pump,
                             @DroolsParameter("thermometer") Thermometer thermometer) {
        return pump.getState() == OFF 
                && thermometer.getFloor().getHeatPump() == pump;
     }
    
    @DroolsConsequence
    public void consequence(@DroolsParameter("pump") HeatPump pump) {
        pump.setState(HEATING);
        System.out.println("FloorTooColdPumpOff: " + pump);
    }
}

For more code examples see:

House Domain Specific Langauge (DSL) Example (Mark Proctor)

The house example illustrates how to implement custom Semantic Modules for a given problem domain, which is also combined with a schema validation file for that domain language.

<rule name="test1">
  <house:condition>
    <house:room name="lounge">
      <house:temperature>
        <house:greater-than scale="C">20</house:greater-than>
      </house:temperature>
    </house:room>
  </house:condition>

  <house:actions>
    <house:room name="lounge">
      <house:heating>off</house:heating>
    </house:room>
  </house:actions>
</rule>

Changelog

  • Bug
    • DROOLS-262 - Retract followed by assert works much faster than modifyObject (Mark Proctor)
    • DROOLS-271 - Tighten annotation module exception handling/throwing (Barry Kaplan)
  • New Feature
    • DROOLS-277 - Define rules using Java5 Annotations (Barry Kaplan)
    • DROOLS-284 - Domain Specific Example (Mark Proctor)
  • Improvement
    • DROOLS-231 - provide a way to assert object containers (such as lists, maps, sets) by name in order to avoid unnecessary subclassing (Mark Proctor)
    • DROOLS-257 - Remove WorkingMemory param from Consequence.tuple(...) (Mark Proctor)
    • DROOLS-274 - Create interface for KnoweldgeHelper (Brian McCallister)
    • DROOLS-280 - Semaphore Constructors with Value (Mark Proctor)
    • DROOLS-282 - ConditionFactory should return Condition[] (Mark Proctor)
    • DROOLS-283 - Make RuleSetReader Handlers use type rather than localName (Mark Proctor)
    • DROOLS-286 - Allow pre JAXP1.2 parsers (Mark Proctor)
    • DROOLS-288 - Update to janino 2.1.0 (Mark Proctor)
    • DROOLS-289 - updated to groovy beta-9 (Mark Proctor)
  • Task
    • DROOLS-228 - Eclipse Developer Instructions (Mark Procotr/Ciprian Bacalu)
    • DROOLS-229 - Idea Developer Instructions (Brian McCallister)
    • DROOLS-270 - Incorporate annotation module into multi-build (Barry Kaplan)

2.0-BETA-20

Release Overview

This is a very quick release to address DROOLS-236. With this release we fix the last known drools bug along with various exception handling improvements, making it an ideal candidate for those already using Drools in production.

Go to Project Downloads to get the latest Drools goodness.

Changelog

  • Bug
    • DROOLS-79 - Exceptions Are Swallowed or Recast (Andy Barnett)
    • DROOLS-235 - difference between Drools manners and the original (Andy Barnett)
    • DROOLS-236 - NullPointerException and ArrayIndexOutOfBoundsException in PrimitiveLongMap (Mark Proctor)
  • Improvement
    • DROOLS-218 - Replace throw/catch of Exception with specific exception classes (Andy Barnett)
    • DROOLS-278 - Better Exception handling for Scheduler (Mark Proctor)

2.0-BETA-19

New and Noteworthy

Sharing of Condition and Join Nodes (Simon Harris)

Condition and join node sharing is now supported in Drools. This reduces the Rete size and speeds up rulesets where you have many similar condition. Currently the expression anlaysis is simple String comparisons, we hope to add AST anlaysis in the near future.

Function definitions for Rulesets (Mark Proctor)

Functions are now supported in Drools. They must be declared after the imports and application-data, but before any rules. They are scoped to the rule-set they are declared in:

<java:functions>
    public void helloWorld(String hello)
    {
        System.err.println(hello + " World");
    }

    public void goodbyeWorld(String goodbye)
    {
        System.out.println(goodbye + " Cruel World");
    }
</java:functions>

Named Semaphores (Mark Proctor)

Named semaphores are primitive wrappers associated with an identifier name, they are a specialised implementation of class-field.

StringSemaphore state = new StringSemaphore("state", "go");
workingMemory.assert(state);
-----------------------------------------------
<rule name="rule 1">
    <parameter identifier="state">
        <semaphore type="String" />
    </parameter>
                
    <java:condition>state.getValue( ).equals("go")</java:condition>
        
    <java:consequence>
        System.err.println( state );
    </java:consequence>
</rule>

yDoc UML for Javadocs

Thanks to the generosity of yWorks we now use yDoc to generate UML diagrams for our Javadocs.

Go to Project Downloads to get the latest Drools goodness.

Changelog

  • Bug
    • DROOLS-223 - maxKey in PrimitiveLongMap is incorrect for the remove method (Mark Proctor)
    • DROOLS-237 - Unreported compilation problem (Andy Barnett)
    • DROOLS-240 - build breaks due to janino (Andy Barnett)
    • DROOLS-242 - TupleSet.removeTuple() can fail because of Collections.singletonMap (Andy Barnett)
    • DROOLS-243 - Generated GraphViz DOT Rete dumps should escape double-quotes (Andy Barnett)
    • DROOLS-246 - PythonFunctions class not JDK 1.3 compatible (Andy Barnett)
    • DROOLS-247 - Fibonacci and State Python Examples Failing with ArrayIndexOutOfBoundsException (Mark Proctor)
    • DROOLS-258 - Agenda.removeFromAgenda() upsets PriorityQueue integrity (Mark Proctor)
  • New Feature
    • DROOLS-162 - Sharing of Condition and Join Nodes (Simon Harris)
    • DROOLS-164 - Function definitions for Rulesets (Mark Proctor)
    • DROOLS-253 - Named Semaphores (Mark Proctor)
  • Improvement
    • DROOLS-92 - Unit testing for EventModel (Mark Proctor)
    • DROOLS-171 - Enhancements to Rete GraphViz-DOT Dumper (Andy Barnett)
    • DROOLS-215 - add getRule() to Activation related events (Mark Proctor)
    • DROOLS-217 - Fix .equals() methods to remove use of instanceof (Simon Harris)
    • DROOLS-219 - Rename like named classes in different packages / semantic modules (Simon Harris)
    • DROOLS-221 - Replace static rule builder methods with instance level methods (Simon Harris)
    • DROOLS-222 - Use checkstyle for smell detection (Andy Barnett)
    • DROOLS-233 - fix drools-all.jar for maven deployment goals (Bob McWhirter)
    • DROOLS-234 - Update ActivationFilter Rule name implementations to take a boolean value for accept (Mark Proctor)
    • DROOLS-238 - Allow assertion of dynamic facts from a consequence (Simon Harris)
    • DROOLS-239 - application data does not honor imports (Mark Proctor)
    • DROOLS-241 - Working Memory Events should provide access to the modified/retracted Object (Andy Barnett)
    • DROOLS-244 - Update project.properies to generate better eclipse projects (Mark Proctor)
    • DROOLS-248 - Drools Exceptions should support JDK 1.4 style Nested Exception functionality (Andy Barnett)
    • DROOLS-249 - Add ANTLR-generated files to CVS (Andy Barnett)
  • Wish
    • DROOLS-225 - ydoc uml for javadocs (Mark Proctor, Bob McWhirter)
    • DROOLS-245 - Implement Waltz Benchmark from OPS5 Benchmark Suite in Drools (Andy Barnett)

2.0-BETA-18

Release Overview

The Drools development team is proud to announce the release of Beta-18.

Simon Harris has added Rocket Fuel to drools. Dependencies on Maps has been reduced and where possible typed Arrays are used instead; this has reduced memory consumption, drastically lowered garbage collection issues and combined with his priority queue for conflict resolution given us phenomenal speed increases.

Mark Proctor has been beavering away around every aspect of Drools from building a centralised fact repository based on a fast Map implementation especially for Drool's needs to improvements in the SMF bringing imports, class-field ObjectTypes, duration, and stronger java support via Janino.

Andy Barnett continues to keep the Ant build environment inline with the Maven one, for all those ant eaters out there, and does sterling work on documentation, code reviews and general tidy ups and of course ensures that Drools continues to be JSR-94 compliant - JSR-94 compliancy tests have now been integrated into the Drool build environment. He also added support for JavaBeans OnPropertyChange listeners.

Bob McWhirter has aided development with his sagely advice and creation of much better drools distribution deployment goals in maven, help making this release the easiest to use ever. Not only do you have the normal drools module jars you now also have a single uber-jar combining all classes for all modules in one jar and also a compiled zip/tar.gz archive of drools with all the needed dependencies.

Go to Project Downloads to get the latest Drools goodness.

New and Noteworthy

Schema Validation

Drools now has full Schema validation, which must be specified in the rule-set attribute schemaLocation:

<rule-set name="test rule-set"
          xmlns="http://drools.org/rules"
          xmlns:java="http://drools.org/semantics/java"
          xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
          xs:schemaLocation="http://drools.org/rules rules.xsd
                             http://drools.org/semantics/java java.xsd">

Validation can be disabled with system property "drools.schema.validating"

No Loop Attribute

Rules now support the no-loop attribute. This stops a modified fact adding the currently executing rule back onto Agenda and thus avoiding infinite recursion. Default is false:

<rule name="test rule" no-loop="true">
    ...
</rule>

Agenda Filter

Drools now allows you to specify an AgendaFilter at fireAllRules time. This allows you to use filters to control whether a rule activated on the Agenda gets fired:

AgendaFilter filter = new AgendaFilter()
{
    boolean accept(Activation activation)
    {
        if (activation.getRule().getName().equals("test rule")
        {
          return false;
        }
       
        return true;
    }
}
workingMemory.fireAllRules( filter );

Durations

You can now delay the firing of an activated rule using the duration element:

<rule name="test rule">
    ....
    <duration seconds="15" />
    ....
</rule>   

Imports

Imports are now supported at the RuleSet level in DRLs. The imported classes can then be used in conditions and consequences as well as <class> and <class-field>. Import on demand via .* is also supported. Imports must be specified as the first element within a rule-set, see rules.xsd for specification:

<rule-set .....>
    <java:import>java.util.*<java:import>
    <java:import>org.drools.examples.fibonacci.Fibonacci<java:import>
   
    <rule name="test rule">
        <parameter identifier="fibonacci">
            <class>Fibonacci</class>
        </parameter>
        ...
    </rule>
</rule-set>

Application Data

Application data must now be defined in a rule-set to enable its use within a condition or a consequence for that rule-set. Identifiers specified in different rule-sets with the same name share the referenced value in the WorkingMemory. Application Data must be either the first element in a rule-set, if no imports exists, or after any imports, see rules.xsd for specification.

<rule-set .....>
    <application-data identifier="map">java.util.HashMap</application-data>
   
    <rule name="test rule">
       ...
       <consequence>
           map.put("string", value);
       </consequence>
    </rule>
<rule-set>

Class Field ObjectType

Drools now supports a new ObjectType <class-field>. This allows you to specify a field and a value to identify a parameter. This allows you to reduce the number of conditions as well as reducing the search space in condition matching as it partitions the search to a more fine grained level than just class. The specified field should be immutable and can currently only be a String constant. Also a class used in a <class-field> element should not later be used in a <class> element as it would have an adverse affect on condition matching:

<rule name="test rule">
    <parameter identifier="a">
        <class-field field="state" value="A">State</class-field>
    </parameter>
    ...
</rule>

Clear Agenda

At any time the Agenda can now be cleared of all activations, causing the ActivationCancelledEvent to fire for each Activation currently on the Agenda.

drools.clearAgenda( )

JavaBean OnPropertyChange Listeners

Drools now has full support for JavaBeans OnPropertyChange events, which allow a Bean to notify the WorkingMemory that it has been modified without the user every having to call modifyObject() directly. See the State example's source code for details on how to implement this feature in your programs.

Parameters

<java:class>, <groovy:class> and <python:class> have all been deprecated for the preferred <class> element.

<rule name="test rule">
    <parameter identifier="fibonacci">
        <class>Fibonacci</class>
    </parameter>
    ...
</rule>

ChangeLog Highlights:

DROOLS-138 Imports now supported in rule-set for python, java, groovy <java:import>java.util.HashMap</java:import> (Mark Proctor)

DROOLS-173 Imports now supported for ObjectTypes in the <class> and <class-field> elements (Mark Proctor)

DROOLS-193 Custom ObjectType that uses field as an attribute <class-field>, see the State example for details (Mark Proctor)

DROOLS-137 Conditions and Consequences are no longer sensitive to white spaces. ApplicationData, imports and Declarations are now added synthetically to Janino, rather than using text mangling (Mark Proctor)

DROOLS-143 WorkingMemory speed up with FactHandleFactory now being a singleton (Jason Anderson)

DROOLS-152 We now have full Schema validation, see http://drools.org/Schema+Validation (Mark Proctor)

DROOLS-187 Schema validation can be disabled with system property "drools.schema.validating" (Mark Proctor)

DROOLS-157 Identity based uniqueness for facts (Simon Harris)

DROOLS-158 Supports retrieval of Object by Class (Bob McWhirter)

DROOLS-113 Access to asserted objects via drools.getObjects() (Bob McWhirter)

DROOLS-180 RuleSetReader has been made made easier to add new elements by refactoring to make it handler based (Mark Proctor)

DROOLS-183 Removed aspects and hard-coded event model (Mark Proctor)

DROOLS-184 Added support for ActivationCancelledEvent (Mark Proctor)

DROOLS-185 A user can now clear the agenda with drools.clearAgenda() (Mark Proctor)

DROOLS-186 Rules now support no-loop attribute to stop recursion (Mark Proctor)

DROOLS-188 Duration is now supported again, to schedule consequences for delayed firing (Mark Proctor)

DROOLS-189 New Distribution goals, to package all dependencies and make uber-jars (Mark Proctor/Bob McWhirter)

DROOLS-128 Access to rule name, drools.getRuleName(), is now available in conditions and consequences (Bob McWhirter)

DROOLS-190 Speed gains from making maps immutable (Simon Harris)

DROOLS-192 Conflict Resolution now supports Priority Queues for big performance improvements (Simon Harris)

DROOLS-191 Support for schemaLocation lookup in classpath; schemas are now more flexible than using fixed schemaSources (Mark Proctor)

DROOLS-163 Filters can now be added to an Agenda to block activations via AgendaFilter (MarkProctor)

DROOLS-207 Support added for JavaBean property change events (Andy Barnett)

DROOLS-212 Removed all traces of extractors from codebase. (Simon Harris)

DROOLS-210 Joins are now deterministic, which should create repeatable deterministic behaviour for Rete networks (Simon Harris)

DROOLS-211 Application Data should now be predefined so that java can precompile (Mark Proctor)

DROOLS-175 drools-java compilation exceptions now report the rule name, the text of the condition or consequence, and the compilation error message (Bob McWhirter)

DROOLS-213 Tuples have been made light-weight, HashMaps have been removed and replaced with array lookups, also they now only contain references to the TupleKey and WorkingMemory. This improves performance and memory usage (Simon Harris)

DROOLS-214 PrimitiveLongMap created for a fast, lightweight, centralised fact repository customised for Drool's needs. Based on Indexed Pages and Direct Address Tables (Mark Proctor)