
All things Artificial Intelligence related: Rules, Processes, Events, Agents, Planning, Ontologies and more :)
Wednesday, March 31, 2010
Michael - signing off

Tuesday, March 30, 2010
Drools OSS Meeting 19th - 23rd of April now at the Hacienda Hotel (San Diego)
A special hotel rate of $110 per night is available under the booking reference "Drools", but hurry as space is limited and we have not done any block reservations. The event itself is free of charge. Breakfast will be provided each morning, as part of the conference, and coffee will be available throughout the day. If anyone would like to sponsor lunch, let me know :) mproctor at codehaus d0t org.
Details of the conference can be found at the registration page here:
http://community.jboss.org/wiki/DroolsBootCampSanDiegoApril2010
The meeting is really shaping up with many top names attending:
JBoss, OSDE (Argentinian Healthcare), AT&T, SAIC, Kaiser, VA, Naval Health Research Center, Clinica, Decision Management Solutions, University of Utah / VA, Intermountain Healthcare, termMed IT, Versatile Systems, GE Healthcare, Open Health Data, Pharmacy OneSource, Wake Forest University Health Science, Recondo Technology, Zementis, University of Maryland, University of Bologna, Duke University.
We have the most excellent James Taylor key noting on Wednesday, with many other interesting talks planned:
Name | Talk |
---|---|
James Taylor (Decision Management Solutions) | Wed 9am Key Note : Smarter systems for uncertain times |
Mark Proctor (JBoss) | Intro to Drools 5 |
Mark Proctor (JBoss) | Rule Authoring Techniques |
Mark Proctor (JBoss) | Spring, Camel and OSGi integration |
Kris Verlaenen (JBoss) | Building Domain Specific Workflows for Clinical Decision Support |
Kris Verlaenen (JBoss) | Dynamic Fragments for Non-Linear Execution of Adaptive Processes |
Edson Tirelli (JBoss) | Applying Complex Event Processing |
Davide Sottara (University of Bologna) | Hybrid Ontologies |
Davide Sottara (University of Bologna) | Enhancing Rules with Uncertainty and Vagueness |
Ken Kawamoto (Duke University) | Clinical Decision Support with HL7 and Drools |
Emory Fry (NHRC) | Delivering Real-Time Clinical Decision Support |
Joe White (Recondo Techology) | Healthcare EDI Processing Using Drools |
Kostas Stathatos (Zementis) | Drools & Predictive Analytics: Follow Your Rules and Listen to Your Data |
Monday and Tuesday are focused on the medical/healthcare industries, but Wednesday onwards are open to all.

Drools OSS Meeting 19th - 23rd of April now at the Hacienda Hotel (San Diego)
Drools halves memory use with new "True Modify" algorithm
The original motivation for this change was from our high end users running large and intensive stateful engines. They found Drools, while favourable compared to our competition, in these large environments was still using large amount of memory and having garbage collection issues; where the GC could not keep up with the rate of allocation and usage and exhibiting very high peaks and troughs.
The latest change introduces something we dubbed "true modify", although we need a better technical name for it, maybe "tree preserving updates", so that it matches the previous Drools 5.0.x algorithm change "tree based removal" for retractions. I previously explained "true modify" in more detail here. The gist of it is that previously an update in the Rete algorithm would pass through the network twice with a retract and then an assert. This meant the network of partial matches that form the Rete tree would be blown away and rebuilt. In cases where only a small amount of the tree genuinely changed it was quite a waste, because it recreated what already existed. True modify performs a single pass through the network and attempts to preserve and re-use partial matches where they where true before and continue to be true now.
Less intensive applications won't see much difference, for instance Manners and Waltz are unchanged, but applications with a large number of objects with repeated modifications should benefit. Using the Drools Planner example as our initial test case for the new algorithm changes we found a 35% speed gain, but more importantly we managed a 50% peak memory reduction with a resulting much smoother curve. We recorded the 5.0.x and trunk graphs and you can see the results for yourself below. I'm hoping our users running truly large, close to 8GB, systems might even receive greater gains; I'll post any results fed back to us.

Drools halves memory use with new "True Modify" algorithm
Monday, March 29, 2010
Dynamic BPM
Gartner [1] suggests that dynamic BPM will become more and more important. Defining your application logic will require a combination of processes, rules and event processing, and I couldn't agree more.
One thing that confuses me though, is that some people seem to position this adaptive case management as a new, separate form of BPM [2]. While I agree that you might need new concepts or a new approach to model, execute and manage these more flexible processes, I don't think they should be considered as completely different. In practice, it is usually better to build on top of solid foundations (in this case traditional BPM) rather than to completely reinvent the wheel. Imho, there don't seem to be any technical reasons why it would not be possible to extend a traditional process engine to be able to support both approaches.
And you definitely don't want to end up with two or three different BPM products [3], just because you have a combination of traditional and non-lineair processes. [Hell, I think you don't even want to end up with 3 different solutions for supporting processes, rules and events (one process engine, one rules engine and one CEP engine that you then need to integrate), but that another discussion.] Especially since I think these are not two completely different kinds of processes, but more like the two extremes of a wide spectrum of processes, where some have a stronger focus on control flow while others are more data-based.

I can only say that we are extremely happy to see that other people are now also seeing the advantage and even the necessity of combining processes, rules and events. Now it's only a matter of time before someone invents a new name for BPM + BRM + CEP [4]
I'll try to do a more technical blog in the next few weeks, and give some concrete examples how Drools [Flow] can be used to create this kind of adaptive processes, using a combination of (what we call) process fragments, rules and event processing.
[1] http://www.gartner.com/it/page.jsp?id=1278415
[2] http://www.xpdl.org/nugen/p/adaptive-case-management/public.htm
[3] http://www.column2.com/2010/03/but-customers-dont-want-three-bpmss/
[4] http://www.bpmredux.com/blog/2010/3/28/its-time-to-define-bpm-for-a-new-era-just-forget-about-the-n.html

Dynamic BPM
Sunday, March 28, 2010
Nurse rostering: design choices
While designing and implementing the Nurse Rostering example for Drools Planner, I am faced with a difficult design choice. In this blog I 'll describe the problem, the choices and my decision.
Concepts and domain classes
Let's start with the relevant concepts and domain classes:
Employee: a person
For example:
Ann
Beth
Carla
Number of Employees: problem specific
Presume 20 Employees
ShiftType: part of a day
For example:
E: Early from 6:00 till 14:00
L: Late from 14:00 till 22:00
Number of ShiftTypes: problem specific
Presume 4 ShiftTypes
ShiftDate: simply a date (year, month and day)
For example:
2010-01-01
2010-01-02
Number of ShiftTypes: problem specific
Presume 100 ShiftDates
Shift: a ShiftType on a certain ShiftDate
For example:
2010-01-01 E
2010-01-01 L
2010-01-02 E
Number of Shifts: ShiftDates * ShiftTypes
4 * 100 = 400 Shifts
Each shift has to be covered by a number of required Employees
requiredEmployeeSize: problem and shift specific
Presume a requiredEmployeeSize of 3 for every shift
Can a shift may have more employees working than there are required? No, not in the competition.
Optional feature moreEmployeesThanRequired: Support more employees working on a shift than required to be modeled as a soft constraint.
For example: 5 Employees working on a shift that requires 3 Employees.
This might be needed so an Employee can get a full week's work.
EmployeeAssignment: an Employee working in a certain Shift
For example:
Ann -> 2010-01-01 E
Beth -> 2010-01-01 E
Carla -> 2010-01-01 L
Only the EmployeeAssignment class changes during planning.
Although I could also used an Employee List on Shift, I already know I wanted a design with a separate EmployeeAssignment class.
This way, the Shift class does not change once the planning starts moving things around.
Also, the score rules will be simpler. They will not contain backwards chaining statements such as “contains”. For example:
rule “canNotWorkOnSunday”
when
$e : Employee()
EmployeeAssignment(employee == $e, shift.shiftDate.dayOfWeek == DayOfWeek.SUNDAY);
then ...
The EmployeeAssignment class only has an Employee field and a Shift field at the moment, nothing more.
Constraints and score rules
There are 2 hard constraints:
oneAssignmentPerDay
Each Employee may only work 1 Shift per day (so only 1 Shift per ShiftDate).
Optional feature multipleAssignmentsPerDay: Support 2 shifts on the same day (for example 2 shifts of 4 hours) to be modeled as a soft constraint.
requiredEmployeeSizePerShift
Each Shift must be equal to its requiredEmployeeSize.
Optional feature moreEmployeesThanRequired: Support more employees working on a shift than required to be modeled as a soft constraint.
The soft constraints do not factor into this design decision at the moment.
Moves
What kind of planning moves can we expect?
ChangeMove
Give an Employee an extra Shift or take one Shift away.
SwitchMove
Between 2 Employees, trade 1 Shift of each Employee.
Later on, more course-grained moves can be added too.
Design alternatives
Let's take a look at the design alternatives and their advantages (+) and disadvantages (-).
Alternative 1:
Introduce the concept of “active” EmployeeAssignments.
Make an EmployeeAssignment for every combination of Employee and Shift
Mark each EmployeeAssignment if it is active or not
The class EmployeeAssignment gets an extra a boolean field called “active”.
For example:
Ann -> 2010-01-01 E is ACTIVE
Ann -> 2010-01-01 L is INACTIVE
Ann -> 2010-01-02 E is INACTIVE
Ann -> 2010-01-02 L is ACTIVE
EmployeeAssignment size: Employees * Shifts
20 * 400 = 8000 EmployeeAssignments
Impact on score rules:
oneAssignmentPerDay is natural (+)
An Employee with 2 active EmployeeAssignments on the same ShiftDate
Optional feature multipleAssignmentsPerDay is possible
requiredEmployeeSizePerShift is an accumulate (-)
A Shift where the count of active EmployeeAssignments is too little (or too big)
Optional feature moreEmployeesThanRequired is possible
Move design:
EmployeeChangeMove is easy (+)
Turns one EmployeeAssignments active or inactive.
EmployeeSwitchMove is bad (-)
Only doable if one of the 2 traded EmployeeAssignments is active
So most EmployeeSwitchMoves are not doable.
Alternative 2:
Introduce the concept of “required” and “optional” EmployeeAssignments.
Make an required EmployeeAssignment for each required assignment per shift
The class EmployeeAssignment gets an extra a boolean field called “required”.
An required EmployeeAssignment never has a null Employee
Make an optional EmployeeAssignment for each optional assignment per shift
An optional EmployeeAssignment can have a null Employee
For example:
Ann -> 2010-01-01 E required
Beth -> 2010-01-01 E optional
Ann -> 2010-01-02 E required
null -> 2010-01-02 E optional
required EmployeeAssignment size: requiredEmployeeSize * Shifts
3 * 400 = 1200 EmployeeAssignments
optional EmployeeAssignment size: (Employees – (requiredEmployeeSize * ShiftTypes)) * Shifts
(20 - (3 * 4)) * 400 = 3200 EmployeeAssignments
total EmployeeAssignment size
1200 + 3200 = 4400 EmployeeAssignments
Impact on score rules:
oneAssignmentPerDay is natural (+)
An Employee with 2 EmployeeAssignments on the same ShiftDate
Optional feature multipleAssignmentsPerDay is possible
requiredEmployeeSizePerShift is build-in (?)
No need to write a score rule (+)
Less moves, smaller search space (+)
Could make it harder to escape from a local optimum region and create a score trap (-)
Optional feature moreEmployeesThanRequired is still possible
Move design:
EmployeeChangeMove is incomplete (-)
Gives one EmployeeAssignment another Employee or null
A required EmployeeAssignments can never get null
It's impossible to remove an Employee from a certain Shift if that Employee is assigned into a required EmployeeAssignment
A more complex move can move in another employee which has an optional EmployeeAssignment for that shift
If and only if such an optional EmployeeAssignment exists.
EmployeeSwitchMove is natural (+)
Not doable if the 2 traded EmployeeAssignments have the same Shift
Alternative 2B:
All EmployeeAssignments are "required", there are no "optional" EmployeeAssignments.
Make an EmployeeAssignment for each required assignment per shift
An EmployeeAssignment never has a null Employee
For example:
Ann -> 2010-01-01 E
Ann -> 2010-01-02 E
EmployeeAssignment size: requiredEmployeeSize * Shifts
3 * 400 = 1200 EmployeeAssignments
Impact on score rules:
oneAssignmentPerDay is natural (+)
An Employee with 2 EmployeeAssignments on the same ShiftDate
Optional feature multipleAssignmentsPerDay is possible
requiredEmployeeSizePerShift is build-in (?)
No need to write a score rule (+)
Less moves, smaller search space (+)
Could make it harder to escape from a local optimum region and create a score trap (-)
Optional feature moreEmployeesThanRequired is NOT possible
Move design:
EmployeeChangeMove is easy (+)
Gives one EmployeeAssignment another Employee (never null)
EmployeeSwitchMove is natural (+)
Not doable if the 2 traded EmployeeAssignments have the same Shift
Alternative 3:
Make an EmployeeAssignment for every combination of Employee and ShiftDate
The EmployeeAssignment class gets an extra field ShiftDate.
An EmployeeAssignment cannot have a Shift with a different ShiftDate.
An Employee that does not work on a certain ShiftDate has a Shift null.
For example:
Ann on 2010-01-01 -> 2010-01-01 E
Beth on 2010-01-01 -> 2010-01-01 E
Ann on 2010-01-02 -> 2010-01-02 E
Beth on 2010-01-02 -> null
EmployeeAssignment size: Employees * ShiftDates
20 * 100 = 2000 EmployeeAssignments
Impact on score rules:
oneAssignmentPerDay is build-in (?)
No need to write a score rule (+)
Less moves, smaller search space (+)
Optional feature multipleAssignmentsPerDay is NOT possible: Utterly impossible to give an Employee 2 Shifts on the same day (-)
Even if the 2 Shifts are only 4 hours long
Even if the hospital really needs it
requiredEmployeeSizePerShift is an accumulate (-)
A Shift where the count of EmployeeAssignments is too little (or too big)
Optional feature moreEmployeesThanRequired is possible
Move design:
ShiftChangeMove is easy (+)
Give one EmployeeAssignment another Shift or null
Do not generate a ShiftChangeMove for an EmployeeAssignment a Shift with a different ShiftDate
ShiftSwitchMove is a complicated (-)
Only doable if the 2 traded EmployeeAssignments have a different Shift
Switching 2 Shifts on different ShiftDates is hard. However my experiment showed that without such a move, it does not rival against alternative 2B.
Alternative 4:
Keep EmployeeAssignment with just an Employee and a Shift field (nothing else).
An EmployeeAssignment never has a null Employee
For example:
Ann -> 2010-01-01 E
Beth -> 2010-01-01 E
Ann -> 2010-01-02 E
EmployeeAssignment size: not fixed. Probably at least requiredEmployeeSize * Shifts and maybe at most double.
Probably at least 3 * 400 = 1200 EmployeeAssignments and maybe at most 2 * 1200 = 2400 EmployeeAssignments.
Impact on score rules:
oneAssignmentPerDay is natural (+)
An Employee with 2 EmployeeAssignments on the same ShiftDate
Optional feature multipleAssignmentsPerDay is possible
requiredEmployeeSizePerShift is an accumulate (-)
A Shift where the count of active EmployeeAssignments is too little (or too big)
Optional feature moreEmployeesThanRequired is possible
Move design:
EmployeeChangeMove is easy (+) (but requires EmployeeAssignmentAddMove and EmployeeAssignmentRemoveMove too)
Gives one EmployeeAssignment another Employee (never null)
EmployeeAssignmentAddMove and EmployeeAssignmentRemoveMove is hard (-)
Creates or removes one EmployeeAssignment from the solution. There might a lot of potential to optimize a MoveFactory which generates both moves.
EmployeeSwitchMove is natural (+)
Not doable if the 2 traded EmployeeAssignments have the same Shift
Design decision
After writing down this updated analysis and an experiment with alternative 3, I 've chosen for alternative 2B. However, if the use case would require to support optional features multipleAssignmentsPerDay and moreEmployeesThanRequired, I would extend it to alternative 4.
Do you think I made the right decision? Why (not)?

Nurse rostering: design choices
Friday, March 26, 2010
Open letter to the jBPM community (Alejandro)
---
Dear jBPM community,
We at JBoss would like to inform you that Tom Baeyens and Joram Barrez have left their position as project lead and core developer respectively. Tom has sharply led jBPM and made it grow into a recognized brand in the business process management arena since joining JBoss back in 2004. Joram brought solid deployment expertise and made profound contributions in areas like performance, integration and standards compliance. Please join us in wishing them the best of luck in their future endeavors.
Despite the sad news, the people at JBoss would like to pledge our commitment to advancing the jBPM project. While this change will undoubtedly impact the jBPM 4 releases in the immediate future, we are busy reorganizing the existing development team and bringing in new blood. The project will continue to pursue the vision of delivering a first class embeddable BPM engine, supporting native BPMN 2.0 execution, providing friendly yet powerful design and monitoring tools, and striving for maximum flexibility and expressiveness in the process language as well as the framework API.
During the flux phase, I will assume the leadership of the jBPM project, make sure the assets remain safe and keep answering your questions in the project forums. As a long-time developer and promoter, my quest for bringing the premier open-source BPM engine to you will continue.
Should you have any questions or comments regarding this announcement, please join the discussion in our user forum.
Sincerely,
Alejandro Guizar
Senior Software Engineer
JBoss by Red Hat

Open letter to the jBPM community (Alejandro)
Thursday, March 25, 2010
Fosdem 50 minute introduction into Drools
http://video.fosdem.org/2010/devrooms/jboss/drools.ogg
There will be a youtube version posted later. Thanks to Heiko Rupp for making this video.
Mark

Fosdem 50 minute introduction into Drools
Monday, March 22, 2010
Drools Language and Engine Enhancement Ideas and Request for Help
I have split this into two sections, one for language enhancements and one for engine enhancements. I've started to flesh out a lot of the language side, the engine side is still headers but should be self explanatory.
Language Enhancements
Engine Enhancements
SQL Operations
As an addition I fleshed out how these enhancements can be used to provide SQL type functionality that we get asked for, such as distinct and group by aggregations.
On the language side it shows how we can move forward making Drools a hybrid language for production rules, functional programming and POSL backward chaining; along with lots of other good ideas. It certainly makes the future look exciting, and shows we've only just got started on the interesting stuff. Just to be clear the functional side of things this is not aimed at competing with scala, clojure or other functional languages, nor is this trying to be a general purpose language like groovy; it's just aimed at providing functional side effect free type operations while evaluating changes to do data; so it's focus and usage is different and still true to it's original intent and spirit.
At the moment this is just a whiteboard of ideas, no priority of order of implementation is intended. So if you have always wanted to get involved in Drools, but not sure what to do, then this is your chance :) Chose an idea, get on IRC and get involved. Also feel free to add comments on the wiki page for changes or additional ideas.
IRC realtime chat
Web Forum

Drools Language and Engine Enhancement Ideas and Request for Help
Friday, March 19, 2010
Drools based research grows

Drools based research grows
Thursday, March 18, 2010
April 19th Drools Meeting 2 day medical/healthcare exclusive, 3 day general topics
Logistics
What: Week long meeting, with 2 day medical/healthcare exclusive, 1 day open to all with medical slant, 2 day open to all all general topics.Where: 10210 Campus Point Drive, San Diego, CA 92121-1598 (SAIC Corporation Headquarters)
When: Monday the 19th of April to Friday the 23rd of April
Previous Boot Camps: San Francisco June 2009
Registration: http://community.jboss.org/wiki/DroolsBootCampSanDiegoApril2010
The boot camp is free, you only need to turn up, but please register here, http://community.jboss.org/wiki/DroolsBootCampSanDiegoApril2010. This page also is a live and more informed version of the information contained here - please read it thoroughly.
Who Should Attend: See the registration page above for more detailed information.
Overview
Mon-Tue (medical only)The the first two days are exclusive to the medical and healthcare communities and only people from medical and healthcare organisations or with a medical background will be allowed to attend.
Wed (medical slant - open to all)
Keynote - James Taylor (Smart Enough Systems) "Smarter systems for uncertain times".
The third day will still maintain a medical slant, wrapping up the last two days, but we will open it up for those that want to observe or participate. We will try and cover topics that will be interesting to all there, even if not from medical background, just be aware that medical discussions take priority. It is recommended that most people start on the Wednesday, especially as we have an excellent keynote speaker for everyone.
Thu-Fri (general topics - open to all)
The last two days is open to all and will hvae no specific topic. It is likely we'll repeat a few talks from mon-tue that are relevant to new comers.
Agenda
Other than the Wednesday keynote with James Taylor, we do not yet have dates and times allocated for talks, as we are still waiting for all talks to be proposed. So if you are thinking of talking, hurry up and let us know :) (see registration page for more info). The registration page will be kept up to date with talks, and contains information and ideas on talks we'd like people to give; basically anything you think people attending will be interested in - it does not have to be drools specific. The current proposed talks are:
Name | Talk |
---|---|
James Taylor![]() | Wed 9am Key Note : Smarter systems for uncertain times |
Mark Proctor (JBoss) | Intro to Drools 5 |
Mark Proctor (JBoss) | Rule Authoring Techniques |
Mark Proctor (JBoss) | Spring, Camel and OSGi integration |
Kris Verlaenen | Building Domain Specific Workflows for Clinical Decision Support |
Kris Verlaenen![]() | Dynamic Fragments for Non-Linear Execution of Adaptive Processes |
Edson Tirelli (JBoss) | Applying Complex Event Processing |
Davide Sottara![]() | Hybrid Ontologies |
Davide Sottara![]() | Enhancing Rules with Uncertainty and Vagueness |
Ken Kawamoto (Duke University) | Clinical Decision Support with HL7 and Drools |

April 19th Drools Meeting 2 day medical/healthcare exclusive, 3 day general topics
Wednesday, March 17, 2010
James Taylor to Keynote for Drools Meeting in San Diego on April 19th


James Taylor to Keynote for Drools Meeting in San Diego on April 19th
Monday, March 15, 2010
April 19th Boot Camp to be open to all
We are looking for people that would like to present, take a focus group or workshop. The topics can be on drools, or how drools is applied, or on projects that use drools, or just general interesting topics for rules, workflow, event processing and ontologies - anything you think the people there would be interested in. Email me if you would like to present
Where - San Diego, CA (meeting place tbc)
Date - Monday the 19th of April to Friday the 23rd of April
Schedule
- Mon-Tue (medical only) The the first two days are exclusive to the medical community and only people from medical organisations or with a medical background will be allowed to attend.
- Wed (medical focus - open to all) The third day will still maintain a medical theme, wrapping up the last two days, but we will open it up for those that want to observe or participate. We will try and cover topics that will be interesting to all there, even if not from medical background, just be aware that medical discussions take priority.
- Thu-Fri (general topics - open to all) The last two days is open to all and will have no specific topic

April 19th Boot Camp to be open to all
Friday, March 12, 2010
CHR 2010 (Constraint Handling Rules)
CHR 2010 - The Seventh International Workshop on Constraint Handling Rules.
"The CHR 2010 Workshop will be held July 20, 2010 in Edinburgh (Scotland) at the occasion of ICLP 2010 (part of FLoC 2010), the premier international venue for presenting research in logic programming.
The Constraint Handling Rules (CHR) language has become a major declarative specification formalism and implementation language for constraint reasoning algorithms and applications. Algorithms are often specified using inference rules, rewrite rules, sequents, proof rules, or logical axioms that can be directly written in CHR. Its clean semantics facilitates program design, analysis, and transformation. See the CHR website for more information.
...
Invited Speaker
We are privileged to announce a distinguished invited speaker this year: Mark Proctor, lead of the thriving, innovating JBoss Drools project. He will be introducing the Drools Business Logic integration Platform, a fully featured business rule engine and management system that seamlessly integrates powerful Complex Event Processing and workflow capabilities."

CHR 2010 (Constraint Handling Rules)
Tuesday, March 09, 2010
Drools Open Source Healthcare Conference, 19th of April, San Diego

Drools Open Source Healthcare Conference, 19th of April, San Diego
Wednesday, March 03, 2010
Nurse Rostering Competition 2010
So expect a Drools Planner nurse rostering example soon :)
Building on the success of the two timetabling competitions, this competition on the nurse rostering problem aims to further develop interest in the general area of rostering and timetabling while providing researchers with models of the problems faced which incorporate an increased number of real world constraints.
The competition is composed of three tracks, called after the Olympic disciplines sprint, middle distance running and long distance running. These tracks represent distinct problem settings in practice and algorithm performance is often tuned to the available running time. The organisers do welcome researchers to trial their techniques on more than one track. The winner of each track receives a prize of €535 and free registration to PATAT in Belfast 2010.
Who's up for some competition? Bring it on!

Nurse Rostering Competition 2010