Author Archives: calcacuervo

Getting Started with Drools Workbench and Execution Server

Nowadays with version 7.5.0.Final as its latest release, getting started with Drools Workbench and Drools Execution Server is easier than any time in its history.

Drools Workbench is the authoring and management user interface that Drools provides. This allows to create Drools projects, author rules, processes, models, etc, manage and deploy servers, etc.

Drools Execution server are servers that can have rules deployed, and being feed and executed from other applications.

How to install them?

Both applications have showcase images in docker, so, getting them is just a matter of pulling the images:

docker pull jboss/drools-workbench-showcase

docker pull jboss/kie-server-showcase

Once this is done, latest version of both are pulled.

To run them, first, you need to start the workbench:

docker run -p 8080:8080 -p 8001:8001 -d –name drools-workbench jboss/drools-workbench-showcase:latest

and then, run one instance of the execution server, pointing to the drools workbench image:

docker run -p 8180:8080 -d –name kie-server –link drools-workbench:kie_wb jboss/kie-server-showcase:latest

And, that’s it!

Workbench will be running in the following link:


And log in with user admin/admin

Screenshot from 2017-12-24 21-09-02.png

And the execution server, here:


With credentials kieserver/kieserver1!

For more information about these docker images, you can check the following links:

Next time, we will explain, how to get started on using drools workbench to do authoring, and then deploying and running it in the execution server.

Leave a comment

Posted by on December 25, 2017 in Drools


Tags: , , ,

Documents Module. Alpha

First advance on documents module for jBPM Console NG!

new ideas

Hello again!

I am here, writing again to show some of the progress I have been able to implement until now.

I have written the first integration with the CMS using CMIS protocol, using Apache Chemistry, for this integration. This will allow to change the CMS used for any that implements the CMIS protocol.

I have created a new module that is used in the console, which can be found here:

and also a fork of the jbpm console code

What I implemented until the moment is all the integration to CMIS, creating a facade service to consume it:

And also, the screens to consume and navigate the CMS tree, through the folders and download the content of the documents.

You can see how it is looking in this video:

I have work in progress for adding and removing documents, as well as editing its properties.

View original post 27 more words

Leave a comment

Posted by on June 22, 2014 in Drools


jBPM in GSOC 2014 again!

I am really happy to share that jBPM will be part of the Google Summer of Code 2014. My friend Nicolas will be implementing an extension to the Kie Workbench, to be integrated with an external CMS. In this case, a really nice and powerful, and open source CMS, called Magnolia.

This will be very helpful for jBPM users, and will enrich its integration capabilities a lot, so I hope to take a look how it will look like! I am sure it will end up being a really nice feature, mentored by salaboy, so it is a guarantee this will be a more than interesting feature.

Nicolas created its own blog, and he wil be sharing some of his progress there.



Leave a comment

Posted by on April 29, 2014 in Drools



Drools Jboss Rules 5.X Developer’s Guide – Review

Hello world!
I had the chance of reading the book Drools Jboss Rules 5.X Developer’s Guide, written by Michal Bali, and I wanted to share my thoughts about this.
This book is intended to show various features of the Drools plattform to be able to succeed on writing rules and use and integrate them in real world applications.
First of all, this book covers all the major topics every person interested in using Drools must read. This effectively transmits the general ideas of when, why and how the use of Drools Plattform will help someone to implement his system, and also when and why NOT it would be helpful, in a clear and easy to understand vocabulary and organization.
The first thing I noticed from this book is the good amount of examples it provides. Examples are really instructive, different scenarios and examples are shown. These examples are all covered by showing the rules, processes, models and services they need, and they all have unit tests showing exactly how they run, which makes them even more helpful for the reader, and will make him save a lot of time!
The most important topics are discussed: Drools Rules, JBPM 5, Complex Event Procesing, with some theoric introductions and a lot of real world information. I personally liked the way jBPM examples are shown in the book, that gives a great idea of how powerful can be using jBPM and rules together in the way the Drools project proposes.
Details are well covered. From how to write simple rules, with the different configurations, syntax options and features, to writing a real application, going through most common implementation and design details a drools developer will have to deal with. Pay attention to Notes, there are always important tips mentioned!
Lastly, I could say as a detail, that I would have liked to read more about the different strategies for storing the rules. Using Drools Guvnor (or not), which are the options and design ideas to take into consideration and most common decisions that must be taken about this.
In conclusion this is a must-read for everyone interested in using Drools project, and it provides useful information for beginners, intermediate and also advanced users of drools. Really recommended book!
Leave a comment

Posted by on December 9, 2013 in Drools



Drools and jBPM 6 Workshops @London

Hello World!

As many of you may know, the Drools team has been working hard for the 6 series of Drools and jBPM. They are comming with really nice new features that you can read in and related blogs. I will be taking about jBPM6 in this blog soon!

On October 23/24th, Mauricio Salatino (aka salaboy) and Michael Anstis will be talking about the new tooling and new stuff, in a free public session in London. The place will be sponsored by Plugtree, and it can be a nice opportunity to get in touch with first hand information on how it all looks like!

If you are wililng to attend, you can contact salaboy to reserve a sit. For more information, you can visit salaboy’s post about this.

Hope you can enjoy it!


Leave a comment

Posted by on October 4, 2013 in Drools


Tags: , ,

GSOC 2012

Hi everyone! I am back to my blog and hopefully I will write again soon!.

This time I will talk about my work in GSOC 2012.

The idea of my project is to allow human tasks to be flexible and configurable, and not simply hardcoded in an mvel file. So, it sound ideal to represent the human task life cycle as a business process.

Here I will talk about the possibilities I reviewed and in the next post I will come up with the finished solution.

Basically, there are two main options: The stateless and stateful option. The “less” or “full” refers to the possibility to save the task state into the process, or treat each state change as a single process instance. Let’s check the two possibilities.

Stateless Approach.

This approach only aims to have a process that captures events, make the desired checks and status changes in tasks and finished. This is not too much business process oriented, but has the flexibility for the user to change the behaviour of each Task Operation.

It could also be represented with a process per each operation, with a conditional event start, which would be a bit more ordered but with same limitations.

This is a test that shows this behavior:

The “Completed”, “Claimed”, “Started” (and will be more) nodes and some special nodes that has the configuration for each node behaviour. If you double-click one of then you will see something like this:

This has all the configuration that nowadays it is in OperationCommand class loaded by an mvel file.

With this approach, the StatefulKnowledgeSession used to run the process does not need to the persistent, as processes just starts and end each time.

Stateful Approach

In this approach, each process instance will represent all the task instance life. For this purposes, the process will look like this (obviously, with the other needed states too):

This seems a bit more real for the task life-cycle. But it required some more work in the coding part. Let’s see this test:

Each task has a StatefulKnowledgeSession associated. When it is put in the jbpm code, in some persisted place, the association between taskId – sessionId should be saved. When an operation for some task comes, the correcte StatefulKnowledgeSession will be loaded and the correct event will be signaled. It makes us think that this session has to be persistent, so we will have to take care about it.

What happens, for example if a now allowed user tries to do an Operation in a task? As the session is persisted and will run into a transaction, an exception in the operation node handler will be thrown (not allowed exception), and the transaction will be rolledback. But if for some security concern the application needs to save a non authorized attempt in some place, this handler could be hooked to override this behaviour.

And what does each Operation Node does? If you see this new human task refactoring approach:

it has a hook to manage the task lifecycle, which is represented by the LifecycleManager interface:

The current implementation is an mvel based one:

The idea with the process based approach will be to have a ProcessLifecycleManager, which will get the session for a task and signal the correct event. And the code that nowadays is in the MVELLifecycleManager that checks if user is allowed and changes the task status, potential owner and other task data will be put inside the Operation Node configured after each event.

I think this last approach will give enough flexibility for jBPM user to understand and change the human task behaviour, and even mixing it with business rules!

So, I will be integrating this approach with the “jbpm-human-task-core-cdi” and I will come back with news.



1 Comment

Posted by on August 2, 2012 in Drools


JBPM 5.1 in Tomcat 6

Hi everyone! I am back to the blog.
Recently I have done some work installing jbpm installer into tomcat again. It took me much less time that the first time :), but this time I decided to automate it, by patching the jbpm 5.1 full installer.First, let me review the steps I followed to deploy the jbpm installer tools in Tomcat 6:

We need a JPA transaction manager to manage our jbpm runtime resources. So, let’s install Bitronix Transaction Manager in tomcat.
First, create in tomcat.home/conf:${btm.root}/work/btm1.tlog${btm.root}/work/btm2.tlog${btm.root}/conf/

Create in tomcat.home/conf, which will have the resources that the transaction manager will manage.

In tomcat.home/conf/context.xml, add this line

<!-- Default set of monitored resources -->
<Transaction factory="" />

In tomcat.conf/conf/server.xml, add this line

<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="" />

Create (or setenv.bat if using windows), with the following:
CATALINA_OPTS=”-Dbtm.root=$CATALINA_HOME$CATALINA_HOME/conf/”This file will be executed by catalina.shwhen starting tomcat

Copy the following jars to tomcat.home/lib
You can take (apart from the two btm jars) the jars from the jboss as installation from the installer.

7.Explode gwt console server, and add a file called context.xml in META-INF/ with the following:

<?xml version="1.0" encoding="UTF-8"?>
 <!-- Default set of monitored resources -->

<Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"
 factory="" uniqueName="jdbc/testDS1" />

Modify web.xml in gwt console server, adding the following:


Modify WEB-INF/classes/META-INF/persistence.xml in gwt console server to look like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0"

<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
 <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
 <property name="hibernate.max_fetch_depth" value="3"/>
 <property name="" value="create" />
 <property name="hibernate.show_sql" value="false" />
 <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />


Add the following jars (taken from jboss as lib) to WEB-INF/lib in gwt console server:

Now, in exploded designer war, add the following jars (taken from jboss as lib) to WEB-INF/lib

Put the exploded wars in tomcat.home/webapps

Start tomcat!
I have developed a patched version of installer to make it all for you:

Hope this helps you!


PS: I will give 5.2 a try this week and update instructions if necessary!


Posted by on December 12, 2011 in Drools


Tags: , , , , ,

On Enter and On Exit Node actions in jBPM5

Hi Everyone, I am back to the blog!

Today I will try to show a quite new feature of jbpm5, which are On Enter and On Exit node actions. As its name indicates, these are actions which will be executed after or before the execution of a node. This is a quite frequently needed feature, that is not included in BPMN 2.0 specification, so now there is a way to include these actions.

There is an example of it in jBPM 5 github:

Now I want to show something similar, but a more real situation were it was very helpful to use it for me.

In Emergency Services, we needed to make some processing on the result variables of a human task. It was not a trivial assignment that it could done (at least I did not see how) with the assignment expressions of the output mappings. Something like this should be done with the variables:

emergency.addUpdate(vehicle.getId(), new VehicleUpdate(comment, priority));

So we made it with an On Exit Node action. These actions are similar to script nodes, and we can get information about the process and also about the node from the kcontext.

We have a node

<userTask id="_12-2-4" name="Update Situation" >

Which has two data output variables,

<dataOutput id="_12-2-4_commentOutput" name="comment" />
<dataOutput id="_12-2-4_priorityOutput" name="priority" />

And also some input variables,

<dataInput id="_12-2-4_emergencyInput" name="emergency" />
<dataInput id="_12-2-4_vehicleInput" name="vehicle" />

Now, we added a On Exit Node action to make our desired processing,

 <tns:onExit-script scriptFormat="">
 Emergency em = (Emergency)((WorkItemNodeInstance)kcontext.getNodeInstance()).getWorkItem().getParameter("emergency");
 Vehicle vehicle = (Vehicle)((WorkItemNodeInstance)kcontext.getNodeInstance()).getWorkItem().getParameter("vehicle");
 String comment = (String)((WorkItemNodeInstance)kcontext.getNodeInstance()).getWorkItem().getResult("comment");
 Integer priority = (Integer)((WorkItemNodeInstance)kcontext.getNodeInstance()).getWorkItem().getResult("priority");
 emergency.addUpdate(vehicle.getId(), new VehicleUpdate(comment, priority));

After the human task node is finished, this script will be executed. As you can see, in kcontext we have access to process, with kcontext.getProcessInstance(), process variables with kcontext.getVariable() and also to node instance and the work itam with kcontext.getNodeInstance().

The full bpmn can be found at

You can also take a look at Emergency Services project source, where you will have lot of Jbpm and Drools examples. Hope this example helps you! Follow us @calcacuervo, @salaboy and @ilesteban.


Leave a comment

Posted by on September 3, 2011 in Drools



Drools and jBPM5 Open Training @London – August 8th/9th

Hi everyone,

Plugtree is going to organize an open training session, that will focus in Drools Expert and jBPM5, and also covering Drools Fusion. It is open to everyone who wants to learn about these projects, no matter if you have previous experience using them or not, as will it cover these technologies essential concepts as well as best practices and project internals.

You can check esteban and salaboy posts for more details, and also the event registration page.



Leave a comment

Posted by on July 18, 2011 in Drools


Tags: , , , , , , ,

Simple rules in my process with a stateless session

I’m back! I have been a bit busy at work. I traveled to BA to attend to the JBPM5/Drools Workshop where the leads of the project gave some excellent presentations. It was great, I was able to meet many of them, discover what’s being done currently and listen about interesting projects (such as Drools Chance, Drools Planner), that I didn’t have time to check yet.

This week I was trying to make rules work JBPM5 when using a persistence and transactions. This was a bit complicated, specially because when calling ksession.fireUntilHalt(), it will create another thread that will work with this session, and was always failing when the fire until halt thread was trying to commit the session. This will be another post, as I could not solve it all yet :).

Anyway, I realized that I only wanted to make a simple evaluation, that will produce a result that will be used to take a decision. And it seemed a work for an StatelessSession that simply evaluates some of the workflow parameters and put the results in the process instance.

So I made a simple workitem, which will have a KnowledgeStatelessSession and will evaluate the rules:

public class StatelessRuleEvaluationWorkItemHandler implements WorkItemHandler {

private StatelessKnowledgeSession ksession;
 public StatelessRuleEvaluationWorkItemHandler(KnowledgeBase kbase) {
 ksession = kbase.newStatelessKnowledgeSession();
 new WorkingMemoryConsoleLogger(ksession);

 public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
 List<Object> facts = new ArrayList<Object>();
 facts.add(new DataInput(workItem.getParameters()));
 DataOutput output = new DataOutput(new HashMap<String, Object>());
 manager.completeWorkItem(workItem.getId(), output.getDataMap());

Then, just assigned the task to this WorkItemHandler:

 "ExceedsRule", new StatelessRuleEvaluationWorkItemHandler(ksession.getKnowledgeBase()));

And created the rule:

rule "Exceeds"
$input: DataInput(dataMap["limit"] < dataMap["count"])
$output: DataOutput()
$output.getDataMap().put("exceeds", new Boolean(true));

rule "NotExceeds"
$input: DataInput(dataMap["limit"] >= dataMap["count"])
$output: DataOutput()
$output.getDataMap().put("exceeds", new Boolean(false));

And it worked fine, the rule was executed, the variable was used in the next node, and there were no problems with persistence. For simple rules, this example can definitely help!

You can check the full example here:

Feel free to ask any question/suggestion!

Thanks for reading!



Posted by on June 29, 2011 in JBPM