Thursday, June 30, 2011

SwitchYard integration is coming for jBPM

For those who might not be familiar,
SwitchYard is a lightweight service delivery framework providing full lifecycle support for developing, deploying, and managing service-oriented applications.

You mean like an Enterprise Service Bus (ESB)? Yeah, kind of. At it's core, SwitchYard provides an embeddable services runtime with limited dependencies, allowing you to deploy and run services where you need them. The main difference between SwitchYard and traditional ESB offerings is that we are trying to make the runtime a transparent detail in the service lifecycle. SwitchYard aims to keep you focused on your services by providing tooling to help define, test, and manage the important details of a service - it's contract, policies, configuration, composition, and management . After all, the least important detail of your service is where it runs.
Good news, as this next-generation ESB will already offer jBPM integration in its 0.2 release, where SwitchYard services can easily be invoked from inside a jBPM process, as a domain-specific service.

For more information, check out the Wiki document and the associated example about the SwitchYard BPM component.


Wednesday, June 29, 2011

jBPM Form Builder project startup

Greetings from Argentina. My name is Mariano De Maio. I'm currently working for Osde on a jBPM sub project for Form Building. Osde is the largest healthcare organisation in Argentina and a big believer and investor in Open Source technologies; they are making it possible for me to work full time on this project for the next year or so.

The jBPM Form Builder is a GWT based form creation UI with the intention of exposing forms to be rendered in a technology agnostic way. This means that through a common interface, and without having to install anything on your computer, you can create forms in a user-friendly to target multiple mediums - GWT (HTML), Flash, PDF etc.

It's intended (at least at first) to provide Human Task forms for the jBPM process definitions, and the first rendering implementations are going to be for script languages like freemarker. But the whole idea of the project is to create a multisystem form developing platform that can provide form definitions at runtime. We intend to build a full MS Access like framework for forms.

The work will all be under the Apache Software License. We don't feel there is anything out there under a liberal ASL/BSD/MIT like license that provides a level of slickness that we wish to achieve. Here's a screenshot of the project as it is at this moment:

You can watch the video from the screenshot above here

It is a great opportunity for everyone who wants to be a part of an interesting project. Feel free to fork the github repo, check it out, or feel free to contact me on the droolsdev IRC

You can download the code from here, and here is where the project is located.
Thanks for your time!


Monday, June 27, 2011

Drools & jBPM team hiring soon

I'll post more details when I have them, but I thought I'd let people know we'll be hiring multiple positions over the next 6 to 9 months for Drools and jBPM.

We'll have an immediate position for a very senior Drools programmer extraordinaire. We'll be looking for someone able to help us build the next generation high performance reasoning engine. The role can be geo-located anywhere, Red Hat HR permitting.

So if you think in ontologies, eat Prolog for breakfast, are fluent in Haskell, able to give a detailed critique of FIPA and explain truth maintenance and defeasible reasoning while also being able to design and build scalable parallel, concurrent and distributed java systems – send me an email :) mproctor at codehaus d0t org


Thursday, June 23, 2011

Drools 5.2 released

We're pleased to announce the release of Drools (Expert, Fusion, Planner, Guvnor) 5.2.0.Final.

This is quite an exciting release as Drools has now become a hybrid chaining engine, capable of executing both the reactive forward chaining rules and now prolog style backward chaining rules for derivation queries. We've added a lot more depth and maturity to the business rules authoring with top notch decision tables and rule templates

At the same time jBPM5.1 has also been release, with full details here:

We've closed a huge number of issues in JIRA:
Drools 286
Guvnor 270

New and Noteworthy


  • MVEL
  • The MVEL dialect has been improved. All variable lookups have been moved to new indexed factories, which should allow faster execution, as well as being simpler code. The build process for MVEL has been reviewed to streamline it to avoid wasteless object creation so that the build time is faster. The ParserConfiguration is now shared which will make each MVEL compilation unit faster to initalise. Configurable type-safety has also been added.

  • Classloader
  • The Classloader has been improved to use a CompositeClassLoader instead of the previous hierarchical "parent" classloader to better support use of Drools within OSGi containers.
See here for details.

Drools Expert and Fusion

  • Lazy Truth Maintenance
  • You no longer need to enable or disable truth maintenance, via the kbase configuration. It is now handled automatically and turned on only when needed.

  • Multi-function Accumulates
  • The accumulate CE now supports multiple functions.

  • Parameterized constructors for declared types
  • Generate constructors with parameters for declared types.

  • Type Declaration 'extends'
  • Type declarations now support 'extends' keyword for inheritance.

  • Free Form expressions in Constraints (New Parser)
  • The parser has been rewritten. We had reached the limitations of what we could achieve in pure ANTLR and moved to a hybrid parser, that adds flexibility to the language. The main benefit with the new parser is that the language now supports free form expressions for constraints and 'from' statements.

  • Rule API
  • A fluent API was created to allow programmatic creation of rules as an alternative to the previously suggested method of template creation.

  • Positional Arguments
  • Patterns now support positional arguments on type declarations.

  • Backward Chaining
  • Drools now provides Prolog style derivation queries, as an experimental feature.

  • Non Typesafe Classes
  • Annotation @typesafe( ) has been added to type declarations allowing for the configuration of type-safe evaluation of constraints.

  • Session Reports
  • An experimental framework to inspect a session and generate a report, either based on a predefined template or with a user created template, has been added.

  • Improved Camel integration
  • Camel integration using the Drools EndPoint was improved with the creation of both DroolsConsumer and DroolsProducer components.
See here for details.


  • Guvnor Look & Feel; moving closer to native GWT
  • We have removed GWT-Ext from Guvnor and now only use GWT.

  • Embed Guvnor Editors
  • We have added the ability to embed Guvnor Editor's in external applications.

  • Annotations come to Declarative Models
  • The ability to add annotations in Guvnor to declarative models has been added.

  • Support for Complex Event Processing in the guided editors
  • The guided editors have been enhanced to allow full use of Drools Fusion's Complex Event Processing operators, sliding windows and entry-points.

  • New guided decision table
  • The existing Guided Decision Table has been replaced to provide a foundation on which to build our future guided Decision Table toolset. The initial release largely provides an equivalent feature-set to the obsolete Guided Decision Table with a few improvements, as listed below.
    1. Cell Merging
    2. Merged Decision Table
    3. Typed-columns
    4. Improved header
    5. Fixed header when scrolling
    6. Negation of Fact patterns
    7. Negation of rules
    8. Support for "otherwise"

  • Enhanced Package's Report
  • Templates Rules and Decision Tables rules are now included in the package's report.

  • Spring Context Editor
  • Now it is possible to create and mange Spring Context files inside Guvnor.

  • Configuring Multiple Guvnor Instances In a Jackrabbit
  • We added a new task in drools-ant which helps with configuring multiple Guvnor instances to be able to share their Jackrabbit content.

  • Configuring Guvnor to use an external RDBMS made easier
  • We added a new section under the "Administration" tab called "Repository Configuration" which helps generate the repository.xml configuration file for a number of databases.
See here for details.


  • Removal of BRL Guided Editor
  • The BRL Guided Editor has been removed due to lack of interest and it falling behind.
See here for details.

Thank you

We would like to thank all the drools community members who helped made this release possible.
The Drools team

JBoss OneDayEvent Munich, October 13th

I'll be speaking about jBPM5 at the JBoss OneDayEvent in Munich on October 13th, 2011.
As the successor of the successful JBoss OneDayTalk 2010 conference, the JBoss User Group Munich e.V. will organize a full day JBoss conference in Munich again. On 13.10.2011, everything will once again revolve around JBoss technologies and Java frameworks, with the focus on current topics such as Enterprise in the Cloud, Security, Operations, High Availability, Scalability, ESB, Web 2.0, Mobile, Clustering, and BPM / BPEL / BRM content.
There will be a lot of interesting presentations about a ton of different JBoss technologies, given by core developers themselves. So this is the ideal opportunity to get all these technical details you're looking for and asking those hard questions! Or just to meet and greet the people behind the projects.

For a full agenda and more details:

Hope to see you there! And if you're quick, you can still take advantage of the early bird discount.


Tuesday, June 21, 2011

Truth Maintenance over Directed Graphs using Reactive Derivation Queries

Drools 5.2 is almost done and we have something very cool added. As previous blogs have mentioned, we recently added positoinal syntax and prolog like derivation query based backward chaining. However those queries were pull only and didn't support the recently added live "open queries". It also had the problem that it was method recursion based, so could blow the method stack if it was too deep.

5.2 is now stack based and supports "open queries", you just miss of the '?'. So what this means is you can have TMS over reactive derivation queries. If I have a key in an envelop on a desk in an office I can add a TMS justifcation that will only exist while the key remains in the office.

This should have some very interesting use cases and I look forward to seeing what people come up with. For instance you could create a rule to monitor a project's maven dependencies and transititive depdencies and receive an alert if ASL/MIT/BSD project has a GPL dependency added via a transititive dependency.

It's a bit abstract, but here is the unit test showing it working:
package org.drools.test  
import java.util.List
import java.util.ArrayList
import org.drools.Person

global List list

dialect "mvel"

declare Location
thing : String
location : String

query isContainedIn( String x, String y )
Location(x, y;)
( Location(z, y;) and isContainedIn(x, z;) )

rule look when
Person( $l : likes )
isContainedIn( $l, 'office'; )
insertLogical( 'blah' );

rule existsBlah when
exists String( this == 'blah')
list.add( 'exists blah' );

rule notBlah when
not String( this == 'blah')
list.add( 'not blah' );

rule init when
insert( new Location("apple", "kitchen") );
insert( new Location("desk", "office") );
insert( new Location("flashlight", "desk") );
insert( new Location("envelope", "desk") );
insert( new Location("key", "envelope") );
insert( new Location("washing machine", "cellar") );
insert( new Location("nani", "washing machine") );
insert( new Location("broccoli", "kitchen") );
insert( new Location("crackers", "kitchen") );
insert( new Location("computer", "office") );

rule go1 when
String( this == 'go1')
list.add( rule.getName() );
insert( new Location('lamp', 'desk') );

rule go2 when
String( this == 'go2')
$l : Location('lamp', 'desk'; )
list.add( rule.getName() );
retract( $l );

rule go3 when
String( this == 'go3')
list.add( rule.getName() );
insert( new Location('lamp', 'desk') );

rule go4 when
String( this == 'go4')
$l : Location('lamp', 'desk'; )
list.add( rule.getName() );
modify( $l ) { thing = 'book' };

rule go5 when
String( this == 'go5')
$l : Location('book', 'desk'; )
list.add( rule.getName() );
modify( $l ) { thing = 'lamp' };

rule go6 when
String( this == 'go6')
$l : Location( 'lamp', 'desk'; )
list.add( rule.getName() );
modify( $l ) { thing = 'book' };

rule go7 when
String( this == 'go7')
$p : Person( likes == 'lamp' )
list.add( rule.getName() );
modify( $p ) { likes = 'key' };


[go1, exists blah, go2, not blah, go3, exists blah, go4, not blah, go5, exists blah, go6, not blah, go7, exists blah]


Person p = new Person();
p.setLikes( "lamp" );
FactHandle handle = ksession.insert( p );


FactHandle fh = ksession.insert( "go1" );
ksession.retract( fh );
assertEquals( "go1", list.get(0));
assertEquals( "exists blah", list.get(1));

fh = ksession.insert( "go2" );
ksession.retract( fh );
assertEquals( "go2", list.get(2));
assertEquals( "not blah", list.get(3));

fh = ksession.insert( "go3" );
ksession.retract( fh );
assertEquals( "go3", list.get(4));
assertEquals( "exists blah", list.get(5));

fh = ksession.insert( "go4" );
ksession.retract( fh );
assertEquals( "go4", list.get(6));
assertEquals( "not blah", list.get(7));

fh = ksession.insert( "go5" );
ksession.retract( fh );
assertEquals( "go5", list.get(8));
assertEquals( "exists blah", list.get(9));

// This simulates a modify of the root DroolsQuery object, but first we break it
fh = ksession.insert( "go6" );
ksession.retract( fh );
assertEquals( "go6", list.get(10));
assertEquals( "not blah", list.get(11));

// now fix it
fh = ksession.insert( "go7" );
ksession.retract( fh );
assertEquals( "go7", list.get(12));
assertEquals( "exists blah", list.get(13));

System.out.println( list );


Monday, June 20, 2011

Drools Planner webinar video

Lots of people showed up at last week's Drools Planner webinar. And I was very happy that I could show up on time too: the Chili volcano got me stuck in Rio en route to the Buenos Aires workshop. So, instead of arriving 2 days in advance, I got up in Rio at 00:30 and arrived at the hotel in Buenos Aires at 12:45, only 15 minutes before the webinar started. Luckily Burr already prepared everything, so despite some initial phone problems on my end, we only had a few minutes of delay. Thanks, Burr :)


Drools Planner optimizes automated planning from JBoss Developer on Vimeo.

You can download the slides from slideshare (only after logging in unfortunately). All the Drools and jBPM presentations are available here. We 'll probably also post the Buenos Aires talk video's, which contains a Drools Planner demo.

See the JBoss webinars homepage for future JBoss webinars. There are some interesting webinars on JBoss AS 7 coming up. Especially the AS 7 startup times are incredible.


I couldn't answer all the questions during the webinar, so here's an answer to the rest of them that relate to Drools Planner:

Marvin: Can I model "changeover" times - after patient D a 1-hour clean-up is required, but after patient H a 4-hour changeover is required?  Or "A to B" is a 1-hr changeover, but "A to C" is a 3-hr changeover?
Of course, but your model will have to be hour (or minute) based instead of day based. Just add a property on PatientAdmission stating the number of changeover hours, add that to your endDateTime to get endWithChangoverDateTime and then use the latter instead in your score rules.

Marvin: Wouldn't it be 310! (ie, 310 * 309 * 308, ...)?
That would result in (310*309*...*1*0*-1*...*-2439) == 0, which is incorrect. Patients that don't share a night can be in the same bed. But the problem is we have to check that as well as the other hard constraints (which is part of the score calculation), so therefor they are included. Furthermore, the best solution might be infeasible and break hard constraints. In that case we'll still want the solution that breaks the least number of hard constraints.

Chris: Will this presentation go over any code examples? or just use cases?
The showed rules are directly copied from the examples. The Drools Planner download zip has the sources of the examples. Also the Drools Planner manual is full of code pieces. In future presentations I 'll try to show more code - there's just too much info I want to cram into 1 hour.

Yogesh: Can we at least see some sample codes with these situations.
Here's an example to use tabu search (see nurseRosteringSolverConfig.xml):

Christian: Can Drools Planner be used to solve optimization problems with continuous or integer variables?
Yes, but there are no examples that do that yet. The trick is to use a non-cached MoveFactory.

Christian: How can I implement my own construction heuristics in Drools Planner?
Yes. In 5.2 or lower, just extend StartingSolutionInitializer. In 5.3, we 'll have a number of out-of-the-box construction heuristics and you 'll still be able to plug in your own.

Stanislas: How well does DS cope with facts changing at high frequency?
I haven't got any hard data on this yet. The nice thing about metaheuristics like tabu search and SA (unlike brute force and branch&bound) is that they can be pauzed, their planning facts changed and continued from their old planning. 5.3 will support partially initialized plannings better, which makes some hacks obsolete. See the new chapter on "real time planning" in the reference manual for 5.3 in my github fork.

Stanislas: airspace navigation problem
Combine several tricks: backup planning, continuous planning and real-time planning. See that new chapter.

Oliver: If set with different score, constraints, the planning result can be different? If so, any way to determine the optimizing one reached?
The data and the constraints will be different in each use case + test data combination. The score is derived from that. Because the problems are NP complete, there's no silver bullet to know if a solution is the optimal solution, unless the optimal solution is the perfect solution (score 0hard/0soft usually), which is very rare.

Sunday, June 19, 2011

What Happened to Truth Maintenance Systems?

I saw this controversial statement in Wikipedia and thought I thought would requote it here. I would imagine there are people that would disagree with this statement on a number of levels. Feel free to add your thoughts to the comments, and I will re-paste them into this blog entry:

What Happened to TMS's?

Does anyone know why nothing has been published on TMS's in the last 15-ish years? Has some other concept replaced them? —Preceding unsigned comment added by (talk) 14:12, 31 October 2007 (UTC)

Assumption-based Truth Maintainance Systems were used in the early 90's as well in the context of some European Projects (ESPRIT) to investigate the use of Expert Systems in Fault Diagnosis and Control. TMS and its variants were eventually dropped from research agendas for two basic reasons: (a) their complexity is inherently exponential, and no clever dependency-directed backtracking or any other short-cut can eliminate this explosion, so such systems are in practice useless; if one wants to work with incomplete information (as is always the case in the real world) one must accept the fact that their conclusions may contain internal contradictions. (b) a lesser reason for the fading out of such systems research may have to do with the fact that the computer programming languages used to develop such systems were mainly LISP (in the US) and PROLOG (in Europe). Both these languages are niche languages and there exist few researchers fluent in these languages today —Preceding unsigned comment added by (talk) 12:45, 21 July 2010 (UTC)


Thursday, June 16, 2011

Drools/jBPM5 Event @ Buenos Aires – Friday, June 17

Finally the Drools Team (except Kris V.) arrives to Argentina yesterday and we cut the Event to just one day. Thank you all for your patience.
The Event will start tomorrow (17th June) at 9 AM and it will be an extreme set of talks until 6 PM. Kris V. will be presenting remotely the "jBPM5 Workflow Overview" session. The Event will be at the Melia Hotel @ Reconquista 945 Capital Federal 1003. You can find a map here.

Update: Alexandre Porcelli will be talking about: "Rules, noSQL and Cloud, Oh My!"
We are doing our best to get everything working for tomorrow, Hope to see you all there!

Wednesday, June 15, 2011

Argentina June Workshop - Friday confirmed

Another update on the Argentina June Workshop !

Seems like the volcano issues are dying out. Mark just called me and he and Michael are finally able to board a plane to Buenos Aires (again). The others should be able to follow shortly.

As a result of all this delay, the Thursday workshop day will unfortunately have to be cancelled. But Friday is confirmed, so the workshop will take place! We'll just have to rearrange the content a little into one day again. And this will give everyone the opportunity to reach Buenos Aires in time as well.

I'm back home, never got any further than Madrid, so they put me on a flight back home instead after two days of hotel and no immediate opportunity to still go the Buenos Aires. I'll do my jBPM5 presentation remotely and will try to be available as much as possible (man, this is Eyjafjallajokull all over again).

But you can't argue with nature! So enjoy the trip and the workshop, from what I've heard it's worth it ;)


Tuesday, June 14, 2011

Argentina June Workshop - Volcano update

We are all still desperately trying to get to Buenos Aires for the 2 day workshop, as previously announced here:

All of us are stranded at various international airports. Geoffrey, Michael, Davide and myself are at Rio de Janeiro. Ray is at Santiago. Edson is at Atlanta. Kris has returned home, having been left at Madrid and will present remotely.

If the gods shine on us and Argentina airspace opens, then we will do our best to be there. So I suggest you all pray to your diety of choice, maybe sacrifice something at the alter. I'm off to pray to the god of Cheese :) I think Camembert is a favourite. (Inspired by the book "Small Gods" from that loveable english writer Terry Pratchet).

Btw if you live in Rio and thinking about doing some development of Drools, you are welcome to come and buy us a drink at the poolside and we'll talk you through the Drools codebase :)

What we may have to do is shorten the workshop to a single day, instead of two days - as we have other commitments in Argentina too. I will update the blog the moment I hear more.

If you have to be stranded anywhere Rio de Janeiro isn't too shabby. Michael and myself are at the Sheraton Rio, which has a private beach and beach side pool etched into the side of a mountain. Curtesy of British Airways :)


Tuesday, June 07, 2011

What If!!! (Open Source Stability and Organisational Success)

Marvel comics do a line of "What If" alternative dimension comics.

So around 2004/2005, I forget the exact date, Drools was still without commercial backing and I was exploring options. I actually had a meeting with ILog to see if it was something they were interested in. I got invited to their UK sales office, where they cordially pumped me for all my client contacts before sending me on my way - which was quite an amusing experience.

Anyway something reminded me of that recently, which made me think about "What if" scenario's and Marvel comics :)

On reflection I'm pleased we joined JBoss, which was later acquired by Red Hat. I don't believe there is any other large organisation more committed to Open Source than Red Hat. More able to build an honest, profitable and long term stable business around Open Source.

The long term stability aspect I think is immensely important, and was really drummed home to me after the Oracle acquisition of Sun. It made me reflect on the other open source companies out there struggling to find a workable business model and the uncertainty that this bring. It seems many explore hybrid business models of 20%+ closed source, children's editions, restriction GPL licensing or confusing "adware" licenses to drive commercial licensing purchases.

I think this is an important consideration. With Red Hat Drools is in a stable environment, with an immensely successful business model that provides stability and long term outlook. You know that Drools is going to be there in 5 years time, that it will receive continued investment and remain 100% committed to OSS. That we won't mess around with different licensing and business models, that RHT won't shelve it due to acquisitions merging issues or start to hamstring it.

Had I taken any other route, be it VC or acquisition by another company, I'm convinced we would either be a hybrid license of 20%+ closed source or a restrictive GPL license to force license purchases, or worse seen as a marketing onramp for the "adult" closed source edition. All of which would have been very negative for the long term adoption of Drools.

Now that Drools is starting to push research boundaries and bringing real value to the field, I feel that this is even more important than ever. We are at a stage now where the really interesting work is starting and are able to do this in a stable environment with a long term outlook on what we are doing and planning. This wouldn't be possible if we were changing business models or technology strategies every 9 months, while we try and find financial stability.

Recently I've been reflecting beyond just technology for a reasons of success and thinking organisationally. It seems companies are getting behind the unified model now, Pega and Tibo are pushing it and the market "gets it". People don't want separate systems for their business logic, they want something unified, integrated and consistent. Not something that is a mess of cognitive dissonance.

We started down this unified path 4+ years ago and the fruits are showing with Drools and jBPM. However on reflection the harder struggle is not a technology one, but an organisational one - aligning development teams and management directions and backing. At Red Hat we now have a singular team and management structure and a cohesive direction to move forward for an integrated rules, workflow and event processing platform. This is a great achievement, probably far more important than our technological achievements to date. It provides great stability and further enhances our ability to plan long term, with everyone on the same page and moving in the same direction. For want of a better word, we have achieved a perfect synergy and will reap the productivity gains as a result :)

Compare this to other large organisations with huge teams in different products, multiple competing acquisitions etc all just starting to move in this direction. Many of them may never be able to resolve the organisational issues necessary to really succeed.

Also see "Drools a reflection on 5 years".

Monday, June 06, 2011

CEP Operators in Guvnor

We are pleased to announce support for Drools Fusion's CEP operators in Guvnor has been added for 5.2. The new feature is available in the Guided Rule Editor, Rule Templates and the Guided Decision Table editor.

We have also added the ability to define Fact annotations in the Declarative Modelling component of Guvnor too. This allows you to add the all important "role" annotation to either your Java or declarative model.

To wrap up the new CEP authoring capabilities you can also define sliding windows and entry-points.

Adding annotations to your model

An example rule in the Guided Editor

Decision Table column definition

You can watch the new features in action here.

Thursday, June 02, 2011

Two Day Drools and jBPM Workshop (Argentina June) - Registration Now open

Volcano Update
You can now register for this event here:

Hurry limited spaces!!!

Thanks to OSDE we now have a 2 day workshop planned in Argentina, Buenos Aires, for June, with nearly all the core Drools and jBPM developers. A MUST attend event for any developer in South America.

We are just finalising locations, agendas and speakers, we'll give more firm details later, but initially the line up is as follows:

Where: Argentina (Buenos Aires)
Date: 16-17 June (Thu/Fri)

Mark Proctor - Group Lead and Drools co-founder
Kris Verlaenen - jBPM Lead
Edson Tirelli - Drools tech Lead
Geoffrey De Smet - Planner Lead
Michael Anstis - Business Tooling tech lead
Ray Ploski - Solutions Architect

Guest Speakers (so far)
Salatino Mauricio (Plugtree)

While us core developers will be focusing on Drools and jBPM, Ray will be there to do talks on AS7, Seam and Infinispan.

Wednesday, June 01, 2011

Maven Central synchronization for new Drools and jBPM artifacts

Starting from Drools 5.2.0.M2 and jBPM 5.1.0.M1 (so including the recently released CR1's), new released artifacts are automatically synced to the Maven Central repository. So you don't need to explicitly add the JBoss maven repository to your pom.xml (or ivy.xml or ...) to use them.

Take a look at the artifacts on maven central here:
A special thanks to Joel Orlina and Paul Gier for making this happen.