Monday, February 19, 2007

Drools 3.1 Milestone 1

3.1-M1 is now avaliable.

Release Notes

Drools 3.1 is the development cycle for the eventually JBoss Rules 3.2 stable release, although the current feature set is looking like this might become 4.0. 3.1-M1 is the first milestone release, which provides an unstable snapshot of the features to date. The documentation will not be updated until the end of the development cycle. The BRMS is not quite ready yet, but should be included in an upcoming milestone release.

New language features
  • 'collect'
    • Reasoning over sets of data, i.e. when you have atleast 6 red buses
  • 'accumulate'
    • Reason and execute actions of sets of data, .i.e allows for summations, averages or other set based calculations.
  • 'forall'
    • The pattern is true for all facts in the working memory
  • 'from'
    • allows for reasoning over facts not in the working memory, this works with globals to pull data locally from services, such as a hibernate session.
  • multi restriction connective field constraints with & and |
    • & and | can now be used on fields inside a Pattern, Person(hair == "blue" | == "brown" )
  • Nested Conditional Elements
    • 'and' and 'or' can now be nested inside 'not' and 'exists'
  • Keyword conflicts resolved
  • Primitive support
    • Primitives are no longer autoboxed
  • FactTemplates
    • Facts can be declared inside the DRL, with no need for a corresponding pojos.
  • Shadow Facts
    • asserted pojos have their values shadowed to ensure the integrity of the working memory against changes made to facts outside of the working memory.

New IDE features
  • Breakpoints in consequences and functions
  • Context assist for all new language features
  • Outline Filtering
  • New GEF based Rete viewer

Saturday, February 10, 2007

JBoss Rules dependencies slim down

As useful as jakarta commons is, it does have a tendency to bloat your classpath, even if just one method is needed from a jar. JBoss Rules uses commons JCI to allow compiler abstraction, which allows us to easily move between the Janino and the Eclipse Java Compiler. JCI relies on commons-logging, commons-lang, commons-collection and commons-io; further to this JCI is split into 3 modules jci-core, jci-janino and jci-eclipse. We have receive a number of complaints on this matter, so I experimented with inlining JCI and ripping out any commons code. The result is we have now reduced our dependency list by 7 additional jars and slimmed the eclipse IDE release down to 7.3MB.

Later I will also move templates from StringTemplate to MVEL, our template use is minimal so we don't really care what we use. MVEL is a needed dependency and already provides templates, so we might as well use that. The added bonus is that StringTemplate still relies on antlr-2.7.7, so I'll be able to remove 2 more dependencies.

As part of this work I have also updated to the latest versions of the Eclipse and Janino compilers, which provide static imports even while targetting jdk1.4 src, we will soon update the function implementation to use static imports, which will make them more robust.

Wednesday, February 07, 2007

JBoss Rules Debug Money Shot

So we are about to put out a milestone release for JBoss Rules, to wet your appetite I thought I'd put out a money shot first. Here you'll see the code paused at a debug point in the consequence of a rule, with all available information displayed in the various views.