Friday, July 31, 2009

Frozen areas to make GUI templates...

A feature recently checked in to trunk: an optional attribute to tell the editor to "freeze" parts of a rule. This is useful if you want to give some users access to some rules - but not change the structure (remove bits, add bits, general mayhem). Users with sufficient permissions can edit options, and can choose to freeze sections:

..after which the editing stuff will be hidden away, and only field values can be edited:
... of course, users with sufficient permissions then can remove the lock as needed:

... allowing them to continue with Project Mayhem if that is what their goal is.

Now to turn this into templates, a few more moving parts are needed (TBD), but basically it involved crafing the templates, locking them (and giving them sensible names) and then allowing people to create rules based on these templates....

Thursday, July 30, 2009

Applying Complex Event Processing (CEP) with a Stateful Rules Engine for Real-Time Intelligence TS-4475

This year Adam Mollenkopf, from Fedex Custom Critical, and myself did a talk at JavaOne:
Applying Complex Event Processing (CEP) with a Stateful Rules Engine for Real-Time Intelligence
TS-4475

While the video is still not available, not sure if it ever will be, the slides can now be found at the above link.

Fedex GIS demo at ESRI (Powered by Drools Fusion)

Custom Critical, at Fedex, do a great demo at this years ESRI conference, that is powered by Drools Fusion. You need to fast forward 2 minutes to get to the meat. They mention that there is a reasoning engine underneath, although not Drools Fusion directly, as it's not relevant to the target audience.

Wednesday, July 29, 2009

"BPMN 2.0 – Marriage Made In Heaven or Trough of Disillusionment" or "Why Software development is like String theory" (BPMfocus)

"By modeling something, we are removing some aspect of the real world in order to represent it. And yet, the IT-oriented folks continue to flail about looking for one true modeling notation and set of semantics to rule them all (like string theory). As though how somehow everything must be translatable and interconnected. I think for most business folks – they don’t really care. They use models to communicate with each other … and yes, they use circles and arrows, and boxes and clouds, and … only a very few have the interest in making them all relate to each other. " "BPMN 2.0 – Marriage Made In Heaven or Trough of Disillusionment" (http://bpmfocus.wordpress.com/2008/10/31/bpmn2/)

I liked the above quote, reminds me of why we have IT in the first place - to support the business. We IT people are so caught up in trying to build perfectly clean, orthogonal and "one true implementation to rule them all" end to end solutions - and the business side just doesn't care about our "OCDs" :)

Tuesday, July 28, 2009

Drools Flow and BPMN2

The Drools team has a commitment to standards. Our task implementation is based on WS-HumanTask, we are working on providing a WS-BPEL execution engine streamlined into the Drools Flow framework, etc. And now 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.

"Drools Flow as a growing
subset of BPMN 2.0"

BPMN 2.0 not only defines a standard on how to graphically represent a business process (like BPMN 1.1), but now also includes execution semantics for the elements defined, and an XML format on how to store (and share) process definitions. Needless to say that this is an important specification in the BPM area.

As Bruce Silver explained is his recent blog:
Our BPMN 2.0 submission passed four key votes and is on track to be an OMG “alpha” specification by the fall. [...] So what’s next? The general membership vote will take 6-8 weeks [...]. We expect this to happen by September. We expect the Finalization Task Force to take up to a year to complete. [...] So what does this mean in plain English? In the FTF phase, implementers (tool vendors) will point out technical problems, but for the most part, what you see now is what you are going to get.
So, now that the BPMN 2.0 spec is starting to stabilize, the time has come to show how we are going to support BPMN 2.0 in Drools Flow.

First of all, we have improved our BPMN skin to conform to the BPMN 2.0 specification. For those who might not know, a skin in Drools Flow defines how to visualize a process (like color, icon, name, etc.). Drools Flow supports pluggable skins, so that users themselves can define the look of a process. The new BPMN2 skin, as shown below, will be used as the default skin from now on. It uses the BPMN2 terminonolgy, icons, etc.



Secondly, we also are looking at using the BPMN 2.0 XML format for storing processes. The BPMN format already closely resembles our Drools Flow language. Most of the Drools Flow constructs also have a one-to-one mapping to a corresponding BPMN construct. BPMN also provides numerous extension points in its model to define additional attributes, node types, etc. whenever necessary.

Therefore, we have defined a new XML mapping to our existing model that allows you read in (and write out) your processes using the new BPMN2 XML format. As a result, you will be able to execute your (executable) BPMN2 processes on the Drools Flow engine. Note that this is not simply a prototype where you can define BPMN2 by hand and execute it standalone, it is integrated in our entire tool chain, so you can use all other Drools Flow features as well of course: persistence and transactions, debugging, Guvnor as the process repository, the web console for process management, audit logging, reporting, etc.

For example, the process shown above can be defined in BPMN2 as follows (note that we added a process variable and a few parameters to make it executable):

<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://schema.omg.org/spec/BPMN/2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd"
xmlns:tns="http://www.jboss.org/drools">

<itemdefinition id="employeeId" structureref="java.lang.String">
<resource id="Employee" name="Employee Resource">

<process id="Evaluation" name="Evaluation Process">

<!-- process variables -->
<property id="employee" itemsubjectref="tns:employeeId">

<!-- nodes -->
<startevent id="StartProcess">
<usertask id="Self_Evaluation">
<potentialowner resourceref="tns:Employee">
<resourceassignmentexpression>
<formalexpression>#{employee}</formalexpression>
</resourceassignmentexpression>
</potentialowner>
</usertask>
<parallelgateway id="Diverge" gatewaydirection="diverging">
<usertask id="Project_Manager_Evaluation">
<potentialowner resourceref="tns:Employee">
<resourceassignmentexpression>
<formalexpression>john</formalexpression>
</resourceassignmentexpression>
</potentialowner>
</usertask>
<usertask id="HR_Manager_Evaluation">
<potentialowner resourceref="tns:Employee">
<resourceassignmentexpression>
<formalexpression>mary</formalexpression>
</resourceassignmentexpression>
</potentialowner>
</usertask>
<parallelgateway id="Converge" gatewaydirection="converging">
<endevent id="EndProcess">

<!-- connections -->
<sequenceflow sourceref="StartProcess" targetref="Self_Evaluation">
<sequenceflow sourceref="Self_Evaluation" targetref="Diverge">
<sequenceflow sourceref="Diverge" targetref="Project_Manager_Evaluation">
<sequenceflow sourceref="Diverge" targetref="HR_Manager_Evaluation">
<sequenceflow sourceref="Project_Manager_Evaluation" targetref="Converge">
<sequenceflow sourceref="HR_Manager_Evaluation" targetref="Converge">
<sequenceflow sourceref="Converge" targetref="EndProcess">

</process>

</definitions>

Using the existing Drools API and tools, you can then simply define, deploy, execute and manage this process, just like you're used to when running your favorite Drools Flow processes. Here's a screenshot of the Drools Eclipse plugin, while defining and testing this simple process (click on it for a larger view).


We will first need to complete our mapping for a few of the remaining Drools Flow concepts (to their corresponding BPMN2 XML representation), so you expect all this somewhere in the course of August.

Tuesday, July 21, 2009

October Rules Festival 2009

Just a reminder that Edson and myself will be at ORF09 in Dallas again this year. This conference has grown and is now a 5 day event, with a lot of big names. I've reproduced the full agenda below:

October Rules Fest 2009
Agenda

Monday
October 26, Tutorials, Day One Conference
12:00 - 14:00

Registration




13:00 - 14:00

Introduction to Rule Harvesting and Knowledge Acquisition,
Rolando Hernandez: ORF Founder & BIZRULES
Manny Gandarillas: Bank of America
Tutorial



14:00 - 15:00

Introduction to Inference Engines
Lawrence Terrill: EBDX
Tutorial



15:00 - 15:30

Q&A and Bio Break



15:30 - 16:30

Introuction to the Rete Algorithm
Lawrence Terrill: EBDX
Tutorial



16:30 - 17:30

Rule Testing Techniques: White Box, Gray Box, Black Box and
Crazy Box Testing

Greg Barton: ORF Founder & Southwest Airlines
Tutorial



17:30 - 18:00

Tutorial Wrapup / Q&A




Tuesday
October 27, Day Two Conference Subject
7:00 - 11:00

Registration



7:45 - 8:00

Welcome and Introductions
James Owen, ORF Founder & KBSC




8:00 - 8:50

A Model-Driven approach for validating rules, documenting requirements, defining system specifications and replacing useless cases
Rolando Hernandez: ORF Founder & BIZRULES
Knowledge Acquisition



9:00 - 9:50

Truth versus Useful Lies
Dr. Daniel Lavine: University of Texas - Arlington
Rule Theory



10:00 - 10:50

Enterprise Architecture 201-A: Creating the Information Age Enterprise
John Zachman: Zachman International
Architecture



11:00 - 11:50

Enterprise Architecture 201-B: Creating the Information Age Enterprise
Dr. Leon Kappelman, North Texas University
Architecture




12:00 - 13:30

Lunch




13:30 - 14:20

SINFERS: The Implementation of a Practical and Modern
Rule-Based Expert System

Jason Morris: Morris Technical Solutions, LLC
Rulebased App



14:30 - 15:20

Graph-Based Knowledgebases & Rules
Luke Voss, Mindview Labs
Rulebased Theory



15:30 - 16:20

Early Alert System at Southwest Airlines
Greg Barton, ORF Founder & Southwest Airlines
Mark Sturdivant, Southwest Airlines
CEP/Rulesbased App



16:30 - 17:20

Automated Verification Testing for Propositional Logic Systems
Dr. Rick Hicks: EZ-Xpert
Testing



17:30 - 18:00

Q&A -
Rolando Hernandez, Dr. Daniel Lavin, John Zachman, Dr. Leon Kappelman, Jason Morris, Luke Voss, Greg Barton, Dr. Rick Hicks




19:00 - 21:00

Pub Night, Location - Walt Garrison Bar




Wednesday
October 28, Day Three Conference Subject
7:00 - 11:00

Registration



8:00 - 8:50

Agile Business Rule Development: a tautology or an oxymoron?
Dr. Hafedh Milir, University of Montréal Québec
Rule Architecture



9:00 - 9:50

Rule Classification First
Eric Charpentier: Primatek
Rule Architecture



10:00 - 10:50

Introduction to Rulebased Forecasting: Updating an Earlier Concept
James Owen: ORF Founder & KnowledgeBased System Corporation
Rulebased App



11:00 - 11:50

Playing With the Rules: Participatory Modeling and Network Gaming
Through a Rules Engine

Andrew Waterman, El Colegio de la Frontera Sur
Rulebased App




12:00 - 13:30

Lunch




13:30 - 14:20

Production Rule Systems - Where do we go from here?
Mark Proctor, Drools
Rule Theory



14:30 - 15:20

Measuring Your Rules' KPIs
Carole Ann Berlioz-Matignon: FICO
Architecture &
Performance



15:30 - 16:20

Designing a System of Rulebased Agents
Luke Voss: Mindview Labs
Rule Theory



16:30 - 17:20

Extending General Purpose Engines with Domain Specific Resources
Edson Tirelli: Drools
Rulebase Design



17:30 - 18:00

Q&A -
Dr. Hafedh Milir, Eric Charpentier, James Owen, Andrew Waterman, Mark Proctor, Carole Ann Berlioz-Matignon, Luke Voss, Edson Tirelli





19:00 - 21:00

Pub Night, Location - Walt Garrison Bar




Thursday
October 29, Day Four Conference Subject
7:00 - 11:00

Registration



8:00 - 8:50

Programming Rules Using a Constraints-Embedded Spreadsheet Interface
Dr. Gopal Gupta, University of Texas Dallas
Rulebased Theory



9:00 - 9:50

Rules Violations and Over-Constrained Problems
Dr Jacob Feldman: Open Rules
Rulebased Design



10:00 - 11:50

Business Rules in the Cloud
Carlos Serrano-Morales: FICO
Architeture



11:00 - 11:50

Rule Patterns and Features in Modern Forward Chaining Engines:
Rules Beyond Business Rules

David Holz: HRSI
Rulebased Theory




12:00 - 13:30

Lunch




13:30 - 14:20

Generating Rules from UML
Daniel Brookshier: No Magic
Rulebased Tools



14:30 - 15:20

Temporal Reasoning: A Requirement for Complex Event Processing
Edson Tirelli: Drools
CEP



15:30 - 16:20

Building Domain-Specific Languages for Rulebased Systems
Luke Voss, Mindview Labs
Rulebased Design



16:30 - 17:20

What's Different About Rules in CEP?
Paul Vincent: Tibco, CTO Business Rules and CEP
CEP



17:30 - 18:00

Q&A -
Dr. Gopal Gupta, Dr Jacob Feldman, Carlos Seranno-Morales, David Holz, Daniel Brookshier, Edson Tirelli, Luke Voss, Paul Vincent





19:00 - 21:00

Pub Night, Walt Garrison Bar




Friday
October 30, Day Five Conference Subject



8:00 - 8:50

The CLIPS Implementation of the Rete Pattern Matching Algorithm
Gary Riley: Gary Riley Consulting
Rulebased Theory



9:00 - 9:50

A Survey of Complex-Event Processing Models
Charles Young: Solid Soft
CEP Theory



10:00 - 10:50

Distributed Programming with Rule Engines
Mark Proctor: Drools
Rulebased App



11:00 - 11:50

Closely Coupled Parallel Rulesbases
Dr. Charles Forgy: Production Systems Technology,
Founder/ Inventor of Rete Algorithm
Rulebased Theory



12:00 - 13:00

Q&A -
All Speakers





13:00 - 14:00

Lunch / Depart Conference

Monday, July 20, 2009

BSG London User Group July09 meeting slides

I've been asked for the slides that I used for the meeting, so here they are:
OpenOffice
PDF

Tuesday, July 14, 2009

Drools User Group Meeting - London 17th of July

Up to date details can be found here:
http://www.bsg.co.uk/Page.aspx?id=2924

14:15 – 18.45, Friday 17th July, BSG House, London, EC1V

The next JBug is being held on Friday 17th July. Attending the JBug at BSG will be a fantastic opportunity to:

  • Enhance your knowledge and skills through specialist speakers talking about hot topics
  • Share your knowledge with like-minded people
  • Network and Socialise

The JBug is a regular gathering of JBoss Professional and other Open Source product users, developers, technical managers and architects. It provides a forum that enables users and customers to get together and discuss new technologies, development methodologies, interesting use cases and similar technical topics. At each meeting, different speakers will present on topics that can be suggested by the group.

The agenda for the JBug has now been finalised and it will focus on open source business rules management system and JBoss BRMS. Presentations include:

  • BRMS Platform 5 Key Note - Mark Proctor, Worldwide JBoss Rules Lead
    State of the Union, Future State
  • BRMS Platform 5 Interactive - Graham Gear, JBoss Solutions Architect
    Simple walk through of using the BRMS Platform
  • BRMS Platform 5 Use Case - BSG
Please click here to register your place at this event.

Monday, July 13, 2009

Drools Simulation and Test framework

I've just got the initial Simulation and Testing framework working with JUnit integration :) Although still lots to do.

It allows Simulations to be run, with tests, for complex apps that involve rules, workflow and event processing all working together over time. This really shows of the Business Logic integration Platform (BLiP) concept and why people should be thinking about using Drools. Rather than the more traditional three different standalone engines with poor integration and totally different approaches, forcing you into a "process oriented" or "rules oriented" world.



When testing your business logic unit tests are not ideal. What you really want to be doing is testing the behaviour of your business logic, to do this you need to execute it in a Simulation environment. Drools 5.0 already has basic simulation and testing in the Guvnor QA tab, however it is not time aware and is specific to rules. By time aware I mean that it creates a session, inserts the facts and just lets it run and then checks the results at the end. For simulation we need to be able to execute specific actions at specific points of time while being able to assert on the engine data (inserted objects, globals and process variables, etc) or the engine state itself (agenda, process instances, etc) at given points in time.

The Simulator runs the Simulation. The Simulation is your scenario definition. The Simulation consists of 1 to n Paths, you can think of a Path as a sort of Thread. The Path is a chronological line on which Steps are specified at given temporal distances from the start. You don't specify a time unit for the Step, say 12:00am, instead it is always a relative time distance from the start of the Simulation. Each Step contains one or more Commands, i.e. create a StatefulKnowledgeSession or insert an object or start a process.
1..1 Simulation
1..n Paths
1..n Steps
1..n Commands
All the steps, from all paths, are added to a priority queue which is ordered by the temporal distance, and allows us to incrementally execute the engine using a time slicing approach. The simulator pops of the steps from the queue in turn. For each Step it increments the engine clock and then executes all the Step's Commands.

Example Command (notice it uses the same Commands as used by the CommandExecutor):
new InsertObjectCommand( new Person( "darth", 97 ) )
Commands can be grouped together, especially Assertion commands, via test groups. The test groups are mapped to JUnit "test methods", so as they pass or fail using a specialised JUnit Runner the Eclipse GUI is updated - as illustrated in the above image, showing two passed test groups named "test1" and "test2".

Using the JUnit integration is trivial. Just annotate the class with @RunWith(JUnitSimulationRunner.class). Then any method that is annotated with @Test and returns a Simulation instance will be invoked executing the returned Simulation instance in the Simulator. As test groups are executed the JUnit GUI is updated.

To make a Simulation more flexible Contexts are used, which provide key/value pair lookups. Each Path has it's own Context, which inherits from a root "global" Context. Commands are executed against given Context identifiers. This allows a Simulation to have a number of ksessions or kbases for maximum flexibility, and Command adapter is used to make the Commands aware. I apologise in advance for the long name used in the adapter class, couldn't think of a shorter name at the time and will refactor later :)

Creates a KnowledgeBase and assigns it to the the identifier "kbase" in the Context for "path1":
cmds.add( new SetVariableCommand( "path1",
"kbase",
new NewKnowledgeBaseCommand( null ) ) );
Creates a StatefulKnowledgeSession and assigns it to the identifier "ksession" in the Context for "path1". The KnowledgeContextResolveFromContextCommand adapts the targeted Command telling it that the KnowledgeBase to be used for the command can be retrieved from the Context using the identifier "kbase". The null arguments could be used to specify a KnowledgeBuilder of StatefulKnowledgeSession if the Command required it:
cmds.add( new SetVariableCommand( "path1",
"ksession",
new KnowledgeContextResolveFromContextCommand(
new NewStatefulKnowledgeSessionCommand( ksessionConf ),
null,
"kbase",
null ) ) );
Now that we have the StatefulKnowledgeSession assigned to the "ksession" identifier we can insert objects into it. Again we used the adapter command to tell it to execute the InsertObjectCommand using the "ksession" instance - the null arguments are the positions used to specify a Knowledgebuilder or KnowledgeBase if the Command required it:
cmds.add( new KnowledgeContextResolveFromContextCommand(
new InsertObjectCommand( new Person( "yoda", 98 ) ),
null,
null,
"ksession" ) );
While the identifier manipulation Commands and Command adapters add a fair amount of verbosity to the api, they also create a very flexible Simulation environment. Tooling will be added that will hide this verbosity and reduce complexity, making it much more palatable.

While it all now works from an API perspective and JUnit integration, building a Simulation programmatically can be a bit verbose. So my next task is to update the existing Command XML, as discussed here, to support the simulation, so that simulations can be defined purely in XML. At the same time we are working on an excel/open office front end to allow simulations to be defined with a Tabular metaphor which I hope should prove very popular.

What's great about this is that it starts to show off the value of the foundations we have built, for rules, workflow and event processing as part of our Business Logic integration Platform (BLiP) concept. Starting first with the unified clock. Drools has single clock for time and scheduling that is pluggable. By default it's a realtime clock based off the JVM system clock. The simulation however switches this to the pseudo clock, allowing programmatic control of time. This allows the Simulator to control the time increments, as based in the Simulation definition. Imagine trying to do this across three different engines. You'd have to hope they had pluggable clock strategies and supported programmatic control before you even started writing 3 different pieces of code to try and correlate the time increases across the engines. Then we have the Command sets that we had already written for interacting with Drools as a service via a "scripting approach - these Commands where especially written to allow the control and mapping of return data and work with rules, workflow and event processing. We can re-use and build on these Commands, and their XML representation, as the foundations of our instruction set for the Simulation definition. Finally there is our general philosophy of rules, workflow and event processing as first class citizens with a seamless and unified approach which ensures we always think about how these technologies work together to give the best possible user experience. As always Drools allows you to do more, by doing less

Saturday, July 11, 2009

JBoss Tools 3.1 - Easy Drools installation on Cocoa 64-bit (ekke)

"Thanks to P2 and thanks to JBoss itsw now very easy to install and update Drools into Eclipse." (ekke)

http://ekkescorner.wordpress.com/2009/07/11/galileo-thx-p2-jboss-easy-drools-installation-on-cocoa-64-bit/

JBoss Tools - http://www.jboss.org/tools



Friday, July 10, 2009

Drools JBoss Rules 5.0 Flow (Part 2)

"Drools JBoss Rules 5.0 Flow (Part 2)

In this two-part article by Michal Bali, we'll look at Drools flow in detail by building a loan approval process. In the first part we covered: faults, subflows, and decisions.

In this part of the article we'll cover: Transfer Funds work Item, human tasks, and other aspects of ruleflow."

http://www.packtpub.com/article/drools-jboss-rules-5.0-flow-part2


  • Develop rules-based business logic using the Drools platform
  • Discover the power of Drools as a platform for developing business rules
  • Build a custom engine to provide real-time capability and reduce the complexity in implementing rules
  • Explore Drools modules such as Drools Expert, Drools Fusion, and Drools Flow, which adds event processing capabilities to the platform
  • Execute intelligent business logic with ease using JBoss/Drools, a stronger business-rules solution
  • Covers examples of a fraud detection system utilizing Drools CEP (Complex Event Processing) capabilities
http://www.packtpub.com/drools-jboss-rules-5-0-developers-guide/book

Drools JBoss Rules 5.0 Flow (Part 1)

"Drools JBoss Rules 5.0 Flow (Part 1)

Every non-trivial business process needs to make complex decisions. A rule engine is the ideal place for these decisions to happen. However, it is impractical to invoke a rule engine from a standard workflow engine. Instead, if we take a rule engine and add workflow capabilities, we have an ideal tool to model complex business processes—Drools Flow.

In this two-part article by Michal Bali, we'll look at Drools flow in detail. We'll build a loan approval process and cover the advanced concepts of a ruleflow like faults, subflows, and decisions."

http://www.packtpub.com/article/drools-jboss-rules-5.0-flow-part1


  • Develop rules-based business logic using the Drools platform
  • Discover the power of Drools as a platform for developing business rules
  • Build a custom engine to provide real-time capability and reduce the complexity in implementing rules
  • Explore Drools modules such as Drools Expert, Drools Fusion, and Drools Flow, which adds event processing capabilities to the platform
  • Execute intelligent business logic with ease using JBoss/Drools, a stronger business-rules solution
  • Covers examples of a fraud detection system utilizing Drools CEP (Complex Event Processing) capabilities
http://www.packtpub.com/drools-jboss-rules-5-0-developers-guide/book

Wednesday, July 08, 2009

A take on Drools Boot Camp 09...

These are my notes and pictures - I am sure others will have notes and pictures to post (if you do have pictures, feel free to email them to me and I will share them here, or links to Flickr or whatever...).

First day, "state of the union":

We had a few kind-of presentations each day, but mostly unstructured. I think it worked pretty well for the most part.

Also had JavaOne duties:

Just a few of the interesting things I worked on with others:

Franklin American crew:
  • a Guvnor plugin to persist rule data to a RDBMS in a reasonably normalised format (that they could mine, use for other things)
  • a design for "smart views" - searches that are persistent based on category, status etc, which can be used to build/run tests and "deploy" (so you are only deploying certain rules in a certain status) - selectors on steroids.
NHIM:
Talked with Emory Fry about a standard rule based "platform" for the National Health Information Network - the idea being a common model, execution server and environment so that rules can be sent as messages, and processed close to where the data lives (rather then having to pull all the data around).

Michael Finger worked on making Jackrabbit clusterable for failover (I expect a blog from him sometime !).

A general point I took away was the different ways people will want to integrate and re-use your code, often in unexpected ways. I need to be more vigilant in leaving clear interfaces, with documentation for others to use, and think more about plug in architectures that allow people to extend things in an safe and upgrade friendly way.

For some R&R some of us went on an epic ride across the Golden Gate Bridge:


Kris Verlaenen tried to kill us a few times, taking us down dead end hills only to ride back up. Kris is quite fit and this meant nothing to him ;) Another fact about Kris: please address him as "Dr Kris" as he actually has a doctorate.

I look forward to next time.

Thursday, July 02, 2009

Drools Job requested - Buenos Aires Argentina

Hi guys and girls out there, my name is Mauricio Salatino (a.k.a. Salaboy), I'm working at a health care company in Argentina, located in Capital Federal, Buenos Aires. I've been working, almost full time, with the Drools team as a contributor for about 8 months now. While the work has been very demanding, requiring a lot of initiative and hard work, it's been hugely rewarding and a fantastic experience both professionally and personally.

My employers would like to hire someone else to work with me (located in Capital Federal, Buenos Aires - Argentina).
The ideal skillset is:

- GWT
- Eclipse RPC
- BAM
- Drools Basics
- Tenacity, Passion and Initiative

While the technical skills are important, it is far more important to find someone with the interest and motiviation to work on Drools. While the best mentoring is available to hand, it's very passive and you need to ask - you will not be spoon fed. The ideal candidate will be able work with minimal guidance and direction under their own initiative. Working on Drools and OSS should be a passion that will drive many long coding nights.


If you know GWT and have experience with BPM, BAM, Business Rules, CEP, or if you are already involved with another Open Source project, this is a great chance for you to get involved.

Interested, think you could meet this challenge to work with one of the most exciting OSS teams in the world? If so then email me with your resume and a covering letter explaining why you are prefect for the position. Please use the email subject heading "DROOLS JOB".

Here is my mail: salaboy@gmail.com

Introducing a new smart forms tool: Drools Advisor

A new tool is in the works that we are currently code naming Advisor (open to other ideas ? perhaps Smart Forms?). This idea came about on talking with the good folks at Solnet Solutions in New Zealand (NZ is also known as Middle Earth !) - they had a need to create Questionnaire style form apps quickly - which were generated dynamically, entirely from writing rules (so they could quickly change, and roll out new apps etc). This was a forms engine with a few twists, and sounded very interesting...

In the last couple of months Solnet have been beavering away on this tool, which will be open sourced soon. There are a few components to it, but first lets look at some samples:

1) "Earth departure card":
(iPhone)

(and web):


2) Tax calculator:


To get the above to work in this tool, only a few things were needed: 1) Some rules to express the question logic, 2) CSS styles to make the forms look how you want (everything is style-able) - to fit in with a given look. Its not just dumb form fields either, there are lots of things you can do, the questions can be quite complex structures etc..

If you were writing rules by hand, they would take the form of:

when
#some conditions go here, or none if you like
then
Question question = new Question();
question.setId("flight");
question.setAnswerType("text");
question.setPreLabel("Flight number / Name of ship");
insertLogical(question);

In the condition part - you do whatever you normally do. If there is no condition part, then obviously it executes. In the RHS is where it is interesting: the tool provides some built in model classes which allow you to "ask questions".

You can then use the answers to that question to drive further questions, and so on (creating a chain of logic, like a decision tree) - so it is intelligently asking the user more questions depending on the answers received. (Truth maintenance - logical assertions, are very useful here, as the user could change an answer, and then the items in the "subtree" below it are no longer needed, and will be retracted automatically):


rule "next country"
when
Question(id == "stayingInNZ", answer != "true");
then
Question question = new Question();
question.setId("countryNext");
question.setAnswerType("text");
question.setPreLabel("or");
insertLogical(question);
end
The above says that when the "stayingInNZ" question is answered (to "not true") then ask them for another country etc...


(by clicking on "Yes" radio button, other questions are revealed - this happens via ajax - talking to the server as the user enters data, executing rules etc).

There are a few components at work: A web front end (based on jQuery) and the Advisor logic itself (which, no surprise, is implemented itself in rules). Obviously this isn't locking it in to web front ends (so you could have other front ends or systems answering questions, not just a user via a web browser).


My sketch above tries to convey the different parts. The Advisor logic lives on the server - hosted in the new "execution server" (more on that in a future post) which is a web server that talks XML to a stateful knowledge session (and of course the Advisor is a model + rules itself). In the web case, the "client" is a javascript library, using jQuery that renders questions based on responses from the knowledge session.

This "client" is generic, and can be hosted in any web page or app (doesn't require java) - it can "hang" off a html "div". CSS provides styling for all controls/fonts/colours (I even saw an example where a slider was used to provide a numeric value).

"Pixie Dust": As we were designing this, we realised most of the logic can and should be implemented in built in rules - we affectionately called these "pixie dust" rules - not meant to be edited or viewed by end users, but they do the magic behind the scenes.

There is much more that is possible: for instance mapping from the "answers" coming back from a user to a pojo which you use in your business rules (so you can use the Q&A stuff as a means to request for more data when needed).

Why this is interesting: using rules and truth maintenance to establish chains of logic allows large Q&A apps to be developed that intelligently ask for more data as needed (eg when evaluating someone for life insurance). Of course, there are features built in such as Groups, which allow more traditional "form" and "page" style behavior that people will expect (much more then can be shown here) - and you have the full power of all the normal things you might want to do with Drools.

Next steps: One of the key aims is to have a domain specific GUI in Guvnor to assist with building these apps end to end (guiding the user to make it as easy as is possible) - and adding the Advisor "pixie dust" to any set of rules, and running these apps (and deploying etc..).

I hope this is an interesting introduction, there is more to come...