Thursday, October 29, 2009

October Rules Fest 2009: Recap

And the October Rules Fest 2009 is finished. One of the best conferences I had the pleasure to attend so far. We had the presence of the great names in the area of business rules, vendors, researchers and users. Not only was possible to learn a lot from the sessions and talks themselves, but during the intervals and pub hours, I had the pleasure to talk to all the smart and nice people that were attending to the conference.

For those that missed, here you can find the recaps of the sessions:
My talks (with Adam Mollenkopf co-presenting on the CEP session) were:
  • Extending General Purpose Engines with Domain Specific Resources - (here) (here) and (slides)
  • Temporal Reasoning: a requirement for CEP - (here) (here) and (slides)
Mark already published about one of his talks and I am sure he will publish about the other.

I am already eagerly awaiting for the next year's conference!

Hats off to James Owen, Greg Barton and all the others that helped making it a reality.


[PS: I will update this post with my slides as soon as they are uploaded]

Tuesday, October 27, 2009

Drools "Where do we go from here" - presented at ORF09

I just delivered my presentation that gives a glimpse into the dark and scary regions of my head, where all the crazy ideas live. It was a hard presentation to write and deliver, as many of the ideas I have no solutions for yet and hadn't tried to formally explain them before other than in a light hearted conversation over a beer. So suddenly when I actually had to formalise the explanations I realised why no one understands me and their eyes gloss over most of the time when I discuss this stuff :)

Where do we go from here

  • Syntax Improvements
  • "else"
  • "otherwise"
  • Logical closures
  • Logical modify
  • Duration, repetition and cron
  • Execution groups
  • MVCC and Transactions
  • POSL - Positional and Slotted Language
  • Federated querries
  • Truth Maintenance System
  • Semantics
  • Sequencing
  • Composition
  • Auditing
  • Backward chaining / Lazy Fact / Field initialisation.
  • Uncertaintity

My first look at Drools (ORF09 Drools Bootcamp feedback)

Google Alerts just notified me of a complimentary blog from Primatex Consulting, providing some feedback on Drools 5.0, our future direction and the ORF09 Drools bootcamp :
"My first look at Drools
What was clear from the presentations I saw and the discussions is that the Drools team obviously is inspired by some commercial products, but they will usually take it to the next level. As an example I can think of the ILOG JRules support for event reasoning, but in the last couple of years, ILOG has stayed away from pushing that functionality, and they have not made it evolve. It has the potential of being very powerful stuff, but ILOG did nothing about it. Drools did.

ABox and TBox

I like idea behind ABox and TBox terminology, in trying to identify that all things are knowledge - be it a class instance or a class definition. They are just different types of knowledge that make up a knowledge base:
"Tbox statements are sometimes associated with object-oriented classes and Abox statements associated with instances of those classes.
TBox statements tend to be more permanent within a knowledge base and tend to be stored in a data model or a metadata registry. In contrast, ABox statements are much more dynamic in nature and tend to be stored as instance data within transactional systems within relational databases."

What I'm wondering is where other types of knowledge fit within this terminology, such as your rules and processes. Are they TBox too?

Friday, October 23, 2009

Spring integration for Drools has landed.

I've just committed the first end to end working Spring integration for Drools. There is still lots more to do, but it at least now allows for end to end working examples. The latest build that includes this work can be found from hudson here:

So how does it work. Lets look at the unit test for more details. The beans.xml provides a configuration for KnowledgeBases, StatefulKnowledgeSession, StatelessKnowledgeSession and the ServiceManager. KnowledgeBases can be confired from a list of resources, that work in the same way that changeset xml does. This allows resources to be pulled from any URL resolveble location, be it classpath, localdisk or from artifacts published from Guvnor:
<drools:kbase id="kbase1">
<drools:resource source="classpath:org/drools/container/spring/testSpring.drl" type="DRL"/>
<drools:resource source="classpath:org/drools/container/spring/IntegrationExampleTest.xls" type="DTABLE">
<drools:decisiontable-conf input-type="XLS" worksheet-name="Tables_2"/>
The above xml shows a KnowledgeBase configured from a DRL and a XLS, remember we could have added DRFs if we wanted workflow in there too.

That KnowledgeBase is now a bean that can be referenced via the id "kbase1". From that bean we can now create sessions. The "type" attribute specifies whether the session is stateful or stateless:
<drools:ksession id="ksession1" type="stateless" kbase="kbase1"/>
<drools:ksession id="ksession2" type="stateful" kbase="kbase1"/>

Those sessions are now beans and can be injected into your own classes using Spring annotations, or used to configure up a Drools ServiceManager.
<drools:serviceManager id="sm1">
<drools:register name="stateless1" ref="ksession1"/>
<drools:register ref="ksession2"/>
The ServiceManager is a new class that I haven't mentioned before that will be in the upcoming Drools 5.1. The ServiceManager can be worked with both locally and remotely. It allows sessions to be created and registered all seamlessly, whether it's local or remote and those sessions are also exposed both locally and remotely. This ties in with the Camel work we are doing to make it easy to work with Drools out of the box in a service and remoting environment and should hopefully provide the ultimate in event driven architectures. I'll blog more on those pieces as they fall into place.

The XSD can be found here: spring-drools.xsd

Once the xml is in place, using it with Spring is a doddle and you can look at the two unit tests to see this in action:
    public void test1() throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "org/drools/container/spring/beans.xml" );

List list = new ArrayList();
StatelessKnowledgeSession kstateless = (StatelessKnowledgeSession) context.getBean( "ksession1" );
kstateless.setGlobal( "list", list );
kstateless.execute( new Person( "Darth", "Cheddar", 50 ) );
assertEquals( 2, list.size() );

list = new ArrayList();
StatefulKnowledgeSession kstateful = (StatefulKnowledgeSession) ((StatefulKnowledgeSession) context.getBean( "ksession2" ));
kstateful.setGlobal( "list", list );
kstateful.insert( new Person( "Darth", "Cheddar", 50 ) );
assertEquals( 2, list.size() );

public void test2() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "org/drools/container/spring/beans.xml" );

ServiceManager sm = (ServiceManager) context.getBean( "sm1" );

List list = new ArrayList();
StatelessKnowledgeSession kstateless = (StatelessKnowledgeSession) sm.lookup( "stateless1" );
kstateless.setGlobal( "list", list );
kstateless.execute( new Person( "Darth", "Cheddar", 50 ) );
assertEquals( 2, list.size() );

list = new ArrayList();
StatefulKnowledgeSession kstateful = (StatefulKnowledgeSession) sm.lookup( "ksession2" );
kstateful.setGlobal( "list" list );
kstateful.insert( new Person( "Darth", "Cheddar", 50 ) );
assertEquals( 2, list.size() );
There is still lots more to do, especially around exposing actual configuration information (JPA etc) and initial setup data (globals, inserted facts) along with extending this to work with Camel. So if you want to help, you know where to find us :)
Mailing Lists

Wednesday, October 21, 2009

III Drools Boot Camp and ORF 2009

Just a friendly reminder, the III Drools Boot Camp and the October Rules Fest 2009 in Dallas start this Sunday, October 25th.

If you didn't signed yet, there might still be time!

If you can't go, I feel sorry for you! ;)

Previous posts about the subject here and here.

See you all there,

Saturday, October 17, 2009

The Secret Sauce

FedEx Custom Critical team is doing an awesome and very innovative work out there. Here you can see Michael Coté interviewing Adam Mollenkopf, Strategic Technologist at FedEx Custom Critical.

In the interview and demo Adam shows one of the applications they are working on and the level of complexity involved in it. The final solution, obviously require a lot of different technologies to achieve its goals, that Adam and the FedEx team puts together. That includes as we can see from the demo the Adobe stack in the front end, Drools Expert for knowledge reasoning, Drools Fusion for event processing, a geo-spatial framework, etc.

The interview+demo is focused on the Adobe technologies, but just to explain which role the "Secret Sauce" (as Michael Coté kindly calls the reasoning engine at the end of the second video) plays on the application, it is enough to say that Drools Expert and Drools Fusion are responsible for processing in real time all the Business Rules involved in such application by applying them to all the data + events coming from all the event sources they listen to. What event sources? An informal way to say:

  • Vehicle positioning stream: "Mr Customer, our truck will arrive at your dock station in 15...5...1 minute!"
  • Shipment stream: "Of course we can take your shipment. In fact we will ring at your door in 7 minutes"
  • Stop event stream: all events from all stops (call them destinations if you will) are tracked
  • Refrigerated Trailers event stream: "Mr Customer, we maintained a valid temperature range of your perishable goods from pickup to delivery.”
  • Traffic flow stream: traffic jams? a new route please....
  • Traffic incidents stream: rough road ahead... can we re-route?
  • Weather stream: fog in Boston airport? re-route to New York!

Drools Fusion just chews all of them, with FedEx's business intelligence modeled as rules and delivers the answers they need.

A nice use case, with a great solution!

Thanks to Michael Coté and to Adam Mollenkopf for the interview and the demo!

Tuesday, October 13, 2009

Drools at the London Cloud Meetup this Wednesday

I'll be at the Cloud Computing London meetup tomorrow (Wed 14th Oct) in London (Clerkenwell). I will be going with Manik (JBoss Cache/Infinispan) and Tim Fox (JBoss Messaging/HornetQ). So if anyone wants to come along for a chat, you know where to find us :)
The Green
29 Clerkenwell Green

How to find us
"We'll have a A4 sign printed out and available on the table in front"

Friday, October 09, 2009

Drools in Japan (warning: Japanese content !)

Red Hat Japan recently ran a successful training event/workshop on BRMS.

Yusuke has been also working on the localization of BRMS's web UI.


Check out the screenshots of BRMS running in Japanese:

Nice work !

Thursday, October 08, 2009

Drools Monitoring with JMX

Drools is designed to support multiple business scenarios. Some of them, known as Decision Services, usually use short lived, stateless session. Others, use stateful sessions, and specially in the case of CEP scenarios, it is very common to have long living sessions that frequently span the whole life of the application.

In such scenarios, the ability to monitor and inspect the contents of the knowledge bases and their associated sessions becomes more and more important.

Drools 5.1 brings support to the JMX standard and enables knowledge base and knowledge session monitoring and inspection using any JMX console. Bellow you can see some screenshots of VisualVM JMX console connected to the Drools Fusion example application.

Knowledge Base stats

Knowledge Base Configuration

Knowledge Session stats

Some of the stats are presented in consolidated graph/values, but individual rule stats are also available through JMX operations. That level of detail even allows users to know which rules are taking longer to fire or which ones are being canceled the most.

Happy Drooling.

Web-based process editing for Drools Flow using Oryx

Recently, we announced that Drools Flow is going to use the BPMN 2.0 XML as the underlying XML serialization format. One of the main advantages of using a standard is that it makes interoperability with other tools much easier. We've been working with the Oryx team to provide web-based editing of processes, which can then be imported and executed on the Drools Flow engine.

Oryx is an open-source project for web-based modeling of business processes, supporting various formats like BPMN, petri-nets, etc. The BPMN 2.0 web-based editor is being developed as part of the Signavio-Oryx Academic Initiative, a joint effort by the Berlin-based startup company Signavio, the Hasso-Plattner-Institute in Potsdam and other universities, which offers a web platform for collaborative process modeling. The platform includes a BPMN 2.0 editor that covers all diagram types. Parts of the platform are made available as open-source through the Oryx project.

The following screencast shows how you could create a simple BPMN 2.0 process using the Oryx editor and then import it into the Drools Eclipse plugin. Here, you could for example add more execution details, debug and test the process, and execute it on the Drools Flow engine, as we already showed in earlier screencasts.

[Note that the screencast shows us transferring the BPMN 2.0 process from Oryx into Drools Flow by simply exporting it as a file using the BPMN 2.0 XML format. We are of course planning to provide more user-friendly integration, by for example integrating this with Guvnor as the process repository.]

Wednesday, October 07, 2009

[Off Topic] Back from my honeymoon

As some of you know I got married last month and have been away on a long honeymoon, but I'm finally back :) I'll make this a small off topic personal entry, hope people don't mind.

We climbed Kilimanjaro, probably hardest thing I've ever done. We walked for 5 days to reach the main ascent point, most of this was for altitude adjustment. It can be done quicker but then you reduce your chances of making it to the top. On the actual day of the final ascent you start off at midnight, it then takes six and a half hours to reach the top. It's 5800M at the top and almost -2o degrees celsuis. Many people suffer from some level of altitude sickness, passing people as they are vomiting wasn't uncommon. I became nauseous on day 2 and had a constant 24/7 migraine for the rest of the 7 days, even with the help of Diamox. The last two hours are excruciating, the only thing that keeps you going is it's harder to go down than it is to just keep going up. At the top the views are fantastic and the glacier is stunning, just a shame it's shrinking at such a fast rate and not likely to be there in 15 years time - definitely one of those things to do before it's gone. Then it's three and a half hours back down. You break for 45 mins, then another 4 hours walking back to camp. So you eventually get back about around 4pm, where you are beyond exhaustion.

We then went on safari in Tanzania, which was much more relaxing. The highlight of this was the night we stayed in a camp site. We where fed the line about the animals walking around the camp, but thought it was an exaggeration to help tourism. A few minutes after I arrived I went to the mens room, then to my complete surprise a ginourmous bull elephant walked past the window, so close I could have touched it. It walked into the camp and stuck it's trunk in the main water storage tank for a drink, with the entire camp site crowding around. Then a herd of zebra walked through the centre of the camp, just metres from our tent and buffalo came to feed at the ends of the grounds. We where also told wild boars frequent the camp at night, so we have to remove any food or empty wrappers from our tent. Safe to say I didn't sleep a wink all night as all I could hear was the hoofs and the snorting of animals outside.

Finally we had a relaxing beach holiday on the island of Pemba at the Fundu Lagoon which I'd really recommend if you just want to get away from the hustle and bustle of modern day life.

For the morbidly curious, you can see our wedding day photo's online now,

As you can see, I'm very lucky with my wife, who loves to tell me I couldn't do better :)

Tuesday, October 06, 2009

Drools 5.1 M1 release notes

We're proud to announce a first milestone release of Drools 5.1. It includes a lot of new features, as described below. So try them out and let us know what you think.

Drools Core and Fusion

JMX Monitoring

JMX monitoring was added to support KnowledgeBase monitoring. This is specially importand for long running processes like the ones usually required for event processing. Initial integration with JOPR was also added.

Drools Flow


With the Business Process Model and Notation (BPMN) 2.0 specification steadily moving forward on its way to become a great standard, we are adopting it for our process modeling in Drools Flow. This includes both the visualization (with a new BPMN2 skin) and serialization to XML. This means that you can save your Drools Flow processes using the standardized BPMN2 XML format. We have already implemented a significant subset of the process elements defined in the BPMN2 specification. A recent blog entry explains this using a simple example.

For more information, check out the BPMN2 chapter in the Drools Flow documentation.

Web-based management console

Drools Flow processes can now also be managed through a web console. This includes features like managing your process instances (starting/stopping/inspecting), inspecting your (human) task list and executing those tasks, and generating reports.

This console is actually the (excellent!) work of Heiko Braun, who has created a generic BPM console that can be used to support multiple process languages. We have therefore implemented the necessary components to allow this console to communicate with the Drools Flow engine.

Check out the console chapter in the Drools Flow documentation for more information, screen shots, etc. A small video of the console in action (as published in an earlier blog) can be found here.

Pluggable variable persistence

Drools Flow can persist the runtime state of the running processes to a database (so they don't all need to be in memory and can be restored in case of failure). Our default persistence mechanism stores all the runtime information related to one process instance as a binary object (with associated metadata). The data associated with this process instance (aka process instance variables) were also stored as part of that binary object. This however could generate problem (1) when the data was not Serializable, (2) when the objects were too large to persist as part of the process instance state or (3) when they were already persisted elsewhere. We have therefor implemented pluggable variable persisters where the user can define how variable values are stored. This for example allows you to store variable values separately, and does support JPA entities to be stored separately and referenced (avoiding duplication of state).

Improved process instance migration

Over time, processes may evolve. Whenever a process is updated, it is important to determine what should happen to the already running process instances. We have improved our support for migrating running process instances to a newer version of the process definition. Check out this section in the documentation for more information.

Drools Guvnor

Discussion feature

A discussion/comment feature for files in Guvnor. More

Inbox feature

Ability to track what you have opened, or edited - this shows up under an "Inbox" item in the main navigator. More

Bulk importer

The Guvnor-Importer is a maven build tool that recurses your rules directory structure and constructs an xml import file that can be manually imported into the Drools-Guvnor web interface via the import/export administration feature. More


PDF document containing information about the package and each DRL asset. DroolsDoc for knowledge package can be downloaded from package view under "Information and important URLs"

BPEL editor

BPEL files can be created, edited and uploaded to Guvnor. The editor is made with Flex.

Guided Rule Editor

Editing rules is made more explicit. Editor is less "boxy" and rules are written more as a normal text. "contains" keyword was added and binding variables to restrictions is now easier.

Decision tables

Keyword "in" was added. Columns can be moved and location of a new row can be selected freely.

General usability and appearance

Appearance has been cleaned, for example less pop ups. Reminders for save after changes in assets and information about actions that were taken, also better error reporting if something goes wrong.

Bug fixes

Most of the bug fixes are related to DSL and enums, also authorization for WebDAV is working.

Eclipse plugin

To support the use of the BPMN2 specification in Drools Flow, a new process skin has been added that more closely resembles the BPMN2 visualization, and a new BPMN2 editor was added that uses the BPMN2 XML format to save the process definition.

Other than that, there were a few small enhancements:
- Fixed an issue with debugging on Eclipse 3.5
- Minor changes to how Drools runtimes are handled in the IDE to make it easier and safer to use