Bio

I was born in Nis, Serbia and lived in Berlin, Germany for seven years before
moving to Atlanta, GA where I received my M.SC. in Computer Science from Georgia
State university in 2005.
Currently employed by Red Hat as Engineer on the Drools team.

In Relation To Tihomir Surdilovic

In Relation To Tihomir Surdilovic

We have completed big parts of the integration between Guvnor and the Oryx web-based business process editor.
Our primary use cases supported by this integration are:

- Viewing existing jBPM5 processes in Guvnor

- Prototyping new jBPM5 processes in Guvnor.

Please note that we are still working on full round-tripping support between the web-based Oryx editor and our BPMN2 support provided through the eclipse plugin.

Oryx is a web-based editor for modeling business processes hosted at Google Code. Oryx is also backed by Signavio, who provides a professionally maintained version. Within Guvnor we integrate with the BPMN2 process designer provided from the Oryx branch which is maintained by Antoine Toulme. The goal of this branch is to apply upstream patches to the Oryx project and it's latest version can be downloaded from github.

To start learning about web-based BPMN2 authoring in Guvnor click on the video link below:

The integration code is currently in the droolsjbpm project master on github. Next step is to download the designer-1.0.0.047-SNAPSHOT-jboss.war from here and deploy it alongside your Guvnor war. No further configuration is necessary. Start up your server and you can start playing with authoring BPMN2 processes in Guvnor.

Here are the slides for my talk at this years JUDCon in Berlin. I was unfortunately not able to make it there in person, however Skype worked out great. Having to get up at 4am to test the connection was the hardest part ;)

The main topic of the talk was on how to apply Drools in Assistive Technology which is considered a non-typical technology field. It shows some of my past research and work in the area of assistive mouse-cursor control and shows how Drools as a fully fledged integration platform can further enhance the overall needs of current assistive technology devices and systems now and in the future.

If you are interested in Drools and Assistive Technology have a look and let me know what you think.

I am starting to move all Drools5 integration code to the Seam 3 drools module and will update the previous posts with correct links as soon as they are available. There will be no further development against the Seam 2.2.Drools5 branch.

Support Events, with their propper semantics, as first class citizens.

Allow detection, correlation, aggregation and composition of events.

Support processing of Streams of events.

Support temporal constraints in order to model the temporal relationships between events.

Support sliding windows of interesting events.

Support a session scoped unified clock.

Support the required volumes of events for CEP use cases.

Support to (re)active rules.

Support adapters for event input into the engine (pipeline).

Seam integration with Drools5 aims to provide full integration with Drools5 Fusion as well as provide Seam-specific convenient ways of interacting with the Fusion module.

In order to show an example of this integration, again, we are going to be dealing with the Numberguess example. This Numberguess example is depicted through a game where users have nine tries to guess a random number between 1 and 100. Each guess triggers a pageflow which in turns calls upon Drools to make a decision (win, lose, or keep guessing) until either the correct number is guessed or nine tries are reached upon which the game ends.

For the Fusion example, we are going to change the game a little. Instead of having nine tries to guess the correct number, the users are going to have one minute to make the right guess. So let's get started:

1. The first change to integrate Fusion in our Numberguess example is in the rules themselves. The GameCount rule is the focal point of the changes and needs to be looked at:

a) there exists an event of type GameStart from the Guess Stream entry point (An entry point is for Drools a gate from which facts come, you can read much more about this in the docs)

and

b) there exists an event of type Guess where the temporal distance between the time of the event is over one minute of the time of the GameStart event (this basically means if the user makes a guess after 1 minute of the initial game start).

If the pattern is matched we set the game decision to lose and provide an appropriate message to the user on why they have lost the game.

2. Now that we have our rule, we are back in our Seam code and need to put it all together. As always first we need to declare our KnowledgeBase in components.xml:

Note the attribute knowledge-base-config which points to kbaseconfig.properties. Drools has two processing modes, namely CLOUD and STREAM. The CLOUD processing mode is the default processing mode and should be familiar to all Drools users. The STEAM processing mode is the mode used when the application needs to process streams of events which is what we need for this example and we tell the engine that we want to use it by defining the property drools.eventProcessingMode in our properties file and setting it to stream.

Note the attribute knowledge-session-config which points to ksessionconfig.properties. Drools Fusion provides two clock implementations out of the box, namely Real Time Clock and Pseudo Clock. Pseudo clock is used for testing and the real time clock internally uses the system clock which we need for our example. We set this in our properties file by setting the property drools.clockType to realtime.

If you are still reading at this point you remember that in our GameCount rule we say that our events come from the Guess Stream entry point. So now we need to define this entry point into which we are going to feed all of our user guess events into:

The new thing here is the ability to pass an entry point to KnowledgeDecisionHandler who knows to inserts events into this entry point. Currently I am working on adding support for multiple entry points to KnowledgeDecisionHandler which is useful when you have multiple event streams feeding events into the rule engine at the same time.

And that's it, with these changes users now have one minute to guess the right number...and it uses Drools Fusion :)

Before I dig into the a Fusion example, I wanted to show current integration with Drools5 Templates. Rule templates are helpful when you have a number of rules which follow some sort of pattern(s). In addition you can use templates when you have reoccurring hard-coded values in your rule patterns or actions. The Seam numberguess example is not the best example for rule templates however is good enough for a simple example.

If we look at base numberguess.drl DRL, we can see some hard-coded values, for example the guessCount is set to 9, the guess increment value is 1 and we also see hard-coded values for win and loose, all of which we want to externalize from our rule resource. This is what our new rule template can look like. If we look at rule Lose we can see some relevant changes:

In order to expand our template, we must provide a data source. With Seam this expansion is driven by custom Seam components which implements the TemplateDataProvider interface that defines a single method:

public Collection<Map<String,Object>> getTemplateData();

For this simple example we implement a template data provider with hard-coded values:

@Name("numberGuessTemplateDataProvider")
public class NumberGuessTemplateDataProvider implements TemplateDataProvider
{
Collection<Map<String, Object>> templateData = new ArrayList<Map<String,Object>>();
@Create
public void init()
{
// We use a Map which provides the values for substituting template parameters.
// It should have a (String) key set matching all of the parameter names.
// Values can be from any class, as long as they provide a good toString() method
Map<String, Object> m1 = new HashMap<String, Object>();
m1.put("wintext", "win"); // substitutes the @{wintext} template parameter
m1.put("losetext", "lose"); // substitutes the @{losetext} template parameter
m1.put("guesscount", 9); // substitutes the @{guesscount} template parameter
m1.put("increment", 1); // substitutes the @{increment} template parameter
templateData.add(m1);
}
// getters and setters
}

Now all that is left is configuration in components.xml. First we define our KnowledgeBase:

Note here that we have only added the name of our template data provider to the rule-resource string...that's it. Last thing to do is to define our StatefulKnowledgeSession as shown in the previous post.

We first define the org.drools.KnowledgeBase and add a single rule resource of type DRL (.drl). This new style of adding resources allows us to add any type of rule resources to the KnowledgeBase (which was not previously possible) and also follows the Drools5 API style (kbuilder.add(ResourceFactory.newClassPathResource("numberguess.drl"), ResourceType.DRL);)

We have to change the handler here to a handler which knows how to work with org.drools.runtime.StatefulKnowledgeSession:

<handler class="org.jboss.seam.drools.KnowledgeDecisionHandler">

And that's it, the numberguess example works as before. It is important to mention one more change made:

the Drools5 API no longer exposes the setGlobalResolver method on org.drools.runtime.StatefulKnowledgeSession and org.drools.runtime.StatelessKnowledgeSession. This is mainly so that other APIs would not abuse this. Instead we now have to add a delegate, for example: