Small steps with big feet
jBPM Screencast: from the drawing board straight to executable BPMN 2.0
In my last blogpost about BPMN 2.0, I already showed how BPMN 2.0 processes could be executed natively on the jBPM4 engine. Of course, the main advantage of BPMN is that we have a standardized and industry-accepted language to describe business processes – executable and non-executable ones. This also means our story is but complete if we have the modelling part covered.
As described in many previous posts, we’re closely collaborating with the guys from Signavio. They have created a fantastic web based BPMN editor and develop the core of the editor in open source.
In this screencast, I show how a BPMN 2.0 process created with the Signavio editor can be exported, dropped into Eclipse and deployed to the jBPM engine – without any change to the process file!
Major milestone:
BPMN 2.0 processes modelled with Signavio
can now directly be executed on the jBPM4 engine
The process I’m using for the screencast is shown below (it is an advanced process we use to test our Inclusive Gateway implementation). Also note that I’m using the cool new embeddable process model feature in Signavio – try to zoom in and out or click on the header
.
Inclusive gateway example
Sign up for your own Signavio account
The example is a bit abstract, but shows clearly how well our BMN 2.0 implementation copes with something as advanced as the inclusive gateway. By the way, many kudos go out to the jBPM PVM (Process Virtual Machine) created by Tom, which made the implementation a breeze. I haven’t found anything in the BPMN 2.0 spec yet which I could throw against it and make it sweat.
All right, time for the screencast. In the screencast, I’m using the online version of Signavio. We’re currently discussion with the Signavio team when and how we’ll ship a BPMN 2.0 editor with the jBPM distribution. Expect some news on this front for the 4.4 or 4.5 release! You can however, try out the fully functional modeller already for a trial period.
I have deliberately been sparse with information in this post, because I’ve added audio to the screencast (and yes, I do have a serious cold :p), so don’t forgot to pump up your speakers as you’ll miss a lot of the fun otherwise. Click on the image below to view the screencast.
Native BPMN 2.0 execution with the freshly released jBPM 4.3
Happy 2010 to all the folks who read this blog! I’m extremely pleased to start this year with a bang by announcing that jBPM 4.3 has been released!
As we announced last month, the major achievement of this release is the native BPMN 2.0 execution on top of the PVM. See the announcement itself for more information, examples and a shiny movie.

The main goal of the first release of our BPMN 2.0 implementation was to implement the ‘basic’ part of the specification. Using the basic constructs, one should already get quite an impression how BPMN 2.0 can be used in practice with jBPM. We’re extremely proud that we’ve managed to include the BPMN 2.0 implementation as an integral part of the jBPM framework. This means that no database or API changes are required when you want to start using BPMN 2.0 with jBPM. Heck, enabling BPMN 2.0 in jBPM requires one single line of configuration. Just check the example of the previous BPMN 2.0 blogpost to see all this sweetness.
The complete distribution zip file can be found on http://sourceforge.net/projects/jbpm/files/
This distribution includes quite a few examples to get you started. The developers guide that is shipped with the distribution also contains a whole new chapter about how to implement BPMN 2.0 processes using jBPM 4.3. The content of the documentation is detailed and people with no prior BPMN 2.0 knowledge should be able to understand it without much problems. See the subdirectory /doc/devguide to find this guide. Or you can take a look online(link to my own version, online doc on docs.jboss.org isn’t yet updated due to past holiday season – but this can change any moment now).
To finish up, let me quote one of our prominent Community Users, Bernd Rücker:
“2010: the year of BPMN 2.0″
Of course, BPMN 2.0 isn’t the only thing we’ve been doing the last two months. Check our JIRA for a complete changelog. Most noteworthy new features are the ejb and jms invocation for JPDL – features that are easy to leverage for a future jBPM BPMN 2.0 release …
As always, thanks for reading!
jBPM goes BPMN!
For those who follow the jBPM internal discussions a bit, the marriage of jBPM and BPMN will come as no surprise. Since this summer we’re coding away at a native BPMN2 implementation on top of our Process Virtual Machine (PVM), and you might have seen tweets or forum posts passing by where the term ‘BPMN’ pops up. However, the only proof were some classes in our SVN trunk …. until now!
In this post I’ll give you a sneak peek of our current BPMN2 execution effort which will be documented, QA’d and incorporated in the jBPM 4.3 release (scheduled January 1st). Many thanks go out to our community members Ronald Van Kuijk and Bernd Rücker, who have contributed a significant amount of ideas and code (and in fact, still are contributing to the BPMN2 implementation now as we speak). This is open-source power at its fullest…
Happy times indeed!
What is BPMN2?
Basically, the Business Process Modeling Notation (BPMN) started out a pure graphical notation standard for business processes, maintained by the Object Management Group (OMG). Version 2.0, which currently is in beta, adds execution semantics to the specification and this is of course where it gets interesting for jBPM.
The primary benefit of BPMN2 is that it is a standard accepted by the IT industry, which means that process models become portable (graphical and execution-wise) across process engines such as jBPM. Since process executions are the raison-d-être of jBPM, it is only natural we are now investing in BPMN2. People who are familiar with JPDL (the current native language of jBPM) will have generally no difficulties in learning the BPMN2 language, as many constructs and concepts are shared. In fact, from a high-level point of view, BPMN2 and JPDL are in concept solving the same problem (which is a biiiiig difference with BPEL – but that’s a story I’ll let other tell).
Of course, this is just the nutshell explanation. You can find a lot more information in our wiki.
Enough talking … show me how it works!
The business process we’re going to implement looks as follows (click to enlarge – created using the wonderful editor from our friends at Signavio).
You might recognize this example, since we’ve also implemented it in JPDL as an example in our distribution.
The business process is simple: an employee can start a new process and make a request for a certain amount of vacation days. After the request task has been completed, the manager will find a verification task in its tasklist. The Manager can now decide to accept or reject this request. Depending on the outcome (that’s the little rhombus on the outgoing transitions, or better said ’sequence flow’ as it is called in BPMN. It means that there is a condition that must be true to follow it), a rejection message is send or the process ends.
As is the case with JPDL, BPMN2 uses an XML language to define the process definition. Our business process looks like this in BPMN2 XML:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="vacationRequest"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd"
xmlns="http://schema.omg.org/spec/BPMN/2.0"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://jbpm.org/example/bpmn2/vacation_request"
xmlns:jbpm="http://jbpm.org/bpmn2">
<process id="vacationRequestProcess" name="BPMN2 Example process">
<startEvent id="start" />
<sequenceFlow id="flow1" name="fromStartToRequestVacation"
sourceRef="start" targetRef="requestVacation" />
<userTask id="requestVacation" name="Request Vacation"
implementation="other">
<potentialOwner resourceRef="user" />
<rendering id="requestForm">
<jbpm:form>request_vacation.ftl</jbpm:form>
</rendering>
</userTask>
<sequenceFlow id="flow2"
name="fromRequestVacationToVerifyRequest" sourceRef="requestVacation"
targetRef="verifyRequest" />
<userTask id="verifyRequest" name="Verify Request"
implementation="other">
<potentialOwner resourceRef="manager" />
<rendering id="verifyForm">
<jbpm:form>verify_request.ftl</jbpm:form>
</rendering>
</userTask>
<sequenceFlow id="flow3" name="fromVerifyRequestToEnd"
sourceRef="verifyRequest" targetRef="theEnd">
<conditionExpression xsi:type="tFormalExpression">
${verificationResult == 'OK'}
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4"
name="fromVerifyRequestToSendRejectionMessage" sourceRef="verifyRequest"
targetRef="sendRejectionMessage">
<conditionExpression xsi:type="tFormalExpression">
${verificationResult == 'Not OK'}
</conditionExpression>
</sequenceFlow>
<scriptTask id="sendRejectionMessage" name="Send rejection Message"
scriptLanguage="bsh">
<script>
<![CDATA[System.out.println("Vacation request refused!");]]>
</script>
</scriptTask>
<sequenceFlow id="flow5"
name="fromSendRejectionMessageToEnd" sourceRef="sendRejectionMessage"
targetRef="theEnd" />
<endEvent id="theEnd" name="End" />
</process>
</definitions>
Most of the constructs are straightforward, certainly if you’re coming from a JPDL background. Do note that the Resource construct isn’t correctly implemented (yet), but that should be solved for the 4.3 release. Also note that you already can add taskforms to your user tasks (see line 33-35 for example).
Also interesting to note is the way how the outcome of the user task is used is for guiding the flow through the process (line 41 and 49). We could have used an exclusive gateway to do the same (which is also already implemented), but we’re using formal expressions on the outgoing sequence flows coming from the user task, just to show you we can.
That’s cool … but I’m a Java developer!
Rest assured: everything that makes jBPM a blessing to use is here to stay. Tom has put a tremendous effort in the jBPM PVM and we now are reaping the fruits of his work. BPMN2 is implemented on top of the PVM, which means that many things come for free: database persistency, database transactions, the service and query API’s, etc. it all just works.
So, when we want to test a business process, we use the same Java approach which we always had with jBPM:
public class VacationProcessTest extends JbpmTestCase {
protected void setUp() throws Exception {
super.setUp();
NewDeployment deployment = repositoryService.createDeployment();
deployment.addResourceFromClasspath("vacationrequest.bpmn.xml")
String deployId = deployment.deploy();
registerDeployment(deployId);
}
public void testRequestRejected() {
ProcessInstance pi = executionService.startProcessInstanceByKey("vacationRequest");
// After process start, peter (employee)
// should be a candidate for the task
Task requestTasktask = taskService.createTaskQuery()
.candidate("peter").uniqueResult();
assertNotNull(requestTasktask);
// After this task is completed,
// a manager (eg alex) is be able to see a 'verify' task
TaskQuery verifyTaskQuery = taskService.createTaskQuery()
.candidate("alex");
assertNull(verifyTaskQuery.uniqueResult());
taskService.completeTask(requestTasktask.getId());
Task verifyTask = verifyTaskQuery.uniqueResult();
assertNotNull(verifyTask);
// When completing the verification task,
// we also need to store the result of the decision
// (will be done through the taskform normally)
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("verificationResult", "not OK");
taskService.completeTask(verifyTask.getId(), vars);
// With a rejection, we should see
// the 'sendRejectionMessage' task in the history log
HistoryActivityInstance hai = historyService.createHistoryActivityInstanceQuery()
.activityName("sendRejectionMessage").uniqueResult();
assertNotNull(hai);
assertProcessInstanceEnded(pi);
}
}
So what you’re seeing here is
- Testing BPMN2 business processes in pure Java code that everybody understands
- in a way which is exactly the same as for JPDL
- and using the very same API which we are all familiar with
- and using the very same database schema as before!
What’s there not to like? In my opinion, the argument of the same API is really really really powerful. The PVM is showing its power at its fullest! To configure your jBPM installation for BPMN2, you just have to add this line to your jbpm.cfg.xml file:
<import resource="jbpm.bpmn.cfg.xml" />
Conclusion: using BPMN2 processes in your application with jBPM is extremely easy. Everything you know about embedding and configuring jBPM is just as before … except that you’re now using a portable and standard process language.
What else?
A lot. Just check our wiki to see what’s planned for the 4.3 release. When talking in pure BPMN2 constructs, these are all planned for next month: Exclusive Gateway (XOR), Parallel gateway (AND), Service Task (Java based), Manual Task, Receive Task (Java only), Script Task, User Task, None start event, None end event, Terminate end event, Sequence Flow, Conditional Sequence flow, Formal expression, Interface (Java), Resource + ResourceParameter. More is possible, if we go to bed a bit later than usual
To finish this sneak peek, here is a screencast of our jBPM console executing the BPMN2 example process which is described above. In this screencast, you’ll see Peter (the employee) requesting 5 days of vacation using our business process. After he finishes the request task, he logs out. Mike, a manager, now logs in and finds the vacation request in his task list. He rejects the request since there is too much work. Peter will now be notified with a rejection message (for this demo, just a printout to the console). The forms you see are using the same taskform mechanism which I described earlier.
The last part of the screencast shows that the reporting functionality, which was already available for JPDL, also works for the BPMN2 processes. Even better, since the PVM defines a shared database schema, reports can aggregate data based on JPDL and BPMN2 processes without any problem!
Until next post!
Joram
jBPM 4 real-life example: The Train Ticket Demo (part 1: modeling the process with BPMN)
For many technical people, the choice for jBPM is a no-brainer. But more than often framework or product decisions are not made by the tech audience, but by managers, project leads, etc. In most cases these people have other criteria than mere technical advantages. Sadly, this can lead to a choice for products which are not developer-friendly and are not appealing to the dev crowd. The goal of the article is to demonstrate that jBPM can offer anything you’d expect from a typical BPM product(read: big vendor BPM black-boxes products) and much more, of course
.
This article is the first in a series of articles (probably five or six parts) in which I’ll show that jBPM has all the shiny features for both developers and non-technical people. We’ll start from the very beginning (modeling a process), do unit testing, prototyping, BAM, BI and in the end we’ve built ourselves a scalable, high-performant application that could go straight into production. The goal of the article is to show to both sides of the playground that jBPM not only offers shiny development features, but also that it can be used to build any BPM-driven application out there. With all the features that non-technical people adore.
Tom Baeyens smoke tested the demo application in his talk on JBoss World. He received a lot of positive feedback there, and we appreciate any feedback on this and the next articles. All the source code will be put online with the articles, so don’t hesitate to show it to all your co-workers or to convince your managers
The business process explained
Picture this: it’s a rainy work-Monday-morning and somehow the wake-up alarm didn’t go off. You’re barely arrive in time in the train station and you remember you don’t have a train ticket. You could go and buy one at the automatic vending machines, but looking at the crowd there, you just know that you’ll never be able to catch your train. You also could look for the train conductor and buy a ticket from him, but often the tickets costs way more than when you buy it upfront. A last option is to not buy a ticket, and look around anxiously every time you hear someone coming, fearing it is someone official checking the tickets. …. Ah choices, choices, choices …. it feels like it’s going to be a long long week!
The problem here is that the ways of buying a train ticket is just soooo old-fashioned and not well-suited for this fast-moving world. The business process we’ll be using throughout the articles solves this problem. More precisely, we’ll model and develop a jBPM process that will handle for us a train ticket sale, using only a cellphone! So even if you are running late, just sending a text message will get you a valid ticket.
Note that we’ve named our ticket sale handling platform ‘jBPM on Rails’, since it seems fancy today to add the ‘rails’ suffix
The business process is graphically shown below (click for a bigger version). Most of it will be described in detail in a next article, but here’s a short summary
- The business process is started when a ticket request is received from a cellphone
- Using the start and end train stations used in the ticket request text message, a price quote will be calculated. The calculation of price quotes is something that already is implemented by the train operator, so we’ll call an external service to actually get the quote.
- If the customer associated with the cellphone has not enough credit on his/her balance, a rejection message is send.
- If the credit is OK, the quote is sent to the customer.
- An ‘accept task’ will now be automatically created.
- The customer can complete this task by sending an acceptance text message.
- Finally the customer is billed and the process finishes. The customer now has a valid ticket.
Modeling for and by the business
The story of every business process starts with the creation of the business process diagram. Often this is done by domain experts (business analysts), but this could be anyone in reality (I’ve seen developers doing the modeling … but this doesn’t mean I agree with it
). Creating a business process takes time. It involves communication with business end-users, other businesses which are interacted with, stakeholders of a company, etc. Typically, the process that you model today will not look anyhting like the same process, next year.
The jBPM 4 platform just offers you this kind of tool. Through our close collaboration with Signavio, modeling a process has never been easier. The Signavio web editor is shipped with the jBPM distribution (since jBPM 4.1) and can be installed in on a web server in less than a minute.

The following screencast shows the creation of the Train Ticket business process by a business analyst. You can see that process modelers only need a web browser to start modeling the process. The Signavio editor uses the widespread BPMN notation, which is known by virtually every business analyst out there. People can collaborate easily on the same process through the browser. The BPMN diagram is eventually saved on the hard disk in the native jBPM JPDL file format, which can be imported into the jBPM Graphical Process Designer (GPD).
What’s next
In the next article, we’ll cover the next phase of the BPM lifecycle: development. We’ll use the process definition produced by the Signavio editor and enhance it with Java logic in Eclipse and the GPD. We’ll show how easy it is to test business processes in plain Java unit tests and how easy jBPM embeds with any Java technology.
Stay tuned for more!
Related
jun 09: jBPM goes web-based modeling
aug 09: Web-based BPMN modeling with jBPM and Signavio
Interesting blog by Khaled Ben Driss (French)
Every morning, during the obligatory coffee injection, I randomly surf the web using jBPM keywords. Due to DZone, java.blogs, Google alert, etc. there isn’t much to find that wasn’t already published on the other channels.
But today I managed to find a blogpost dating back to last month, which had apparently slipped through. So I’m relinking it here, to give it the attention it deserves. The article gives a high-level overview of jBPM4 and compares it with some properties of jBPM3. In my opinion, the quality of the articles is great (or is it my French?), so give the other (jBPM) articles also a read. Enjoy!
http://net-progress.blogspot.com/2009/07/jbpm-4-tutorial-jbpm-4-simplifie-son.html
Announcement: Web-based BPMN modeling with jBPM and Signavio!
About a month ago, I wrote about the collaboration between jBPM and Signavio.
I got many enthousiastic reactions on this announcement, so I’m extremely excited to be able to announce today that the Signavio editor will be bundled with upcoming jBPM 4.1 release. The target release date of jBPM 4.1 is next month, 1st of September … yes, that’s less than a month away!
Also, for those of you who will attend JBoss World next month, don’t miss the presentation of Tom Baeyens. I’m quite convinced he’ll have more of this fine news up his sleeve.
To show that we mean serious business, here’s a sneak peek of the Signavio editor used to create a BPMN model which is stored as jBPM JPDL. Many thanks to the Signavio and Oryx people for the top-notch collaboration!
Click the image below for a 7 minute video screencast. The screencast shows the creation of a simple BPMN process, which is then used in a JBPM unit test.
regards,
Joram
Quick book review: ‘The Process – Business Process Modeling Using BPMN’
Due to the fact I was sick today, I was able to work a bit on my book backlog. So, when I was waiting in the doc’s office, I finally finished ”The Process – Business Process Modeling Using BPMN‘, written by researchers of the Business Process Technology Group of the university of Potsdam.
The book tells the story of Tom, who is hired by the fictional company LasterTec to provide insights into how LaserTec works. While on the job, he learns about process modeling and BPMN. The following chapters describe the journey of Tom into the BPMN landscape, and how he is able to document and find bottlenecks int the processes of LasterTec. If you want to know how the story ends, you should give the book a reading
So, here are in short the pro’s and con’s of the book:
Pro
- The book is entry-level. Since I already have some BPMN experience I was able to quickly go through the first chapters, but I found myself concentrated while reading the more complex stuff (specifically on of the latests chapters on compensating activitites and business transactions). However, if you are already experienced in the BPMN field, this book will teach you not much new.
- The BPMN information is nicely integrated with the story of Tom. So you’re getting an actual story that, for me, is much nicer to read than your average tech book. The story also allows you to digest the information easier. The downside of this approach is that the book is not a reference. Luckily, the book contains a BPMN reference poster, which you can also download here.
- Many of the processes that Tom encounters are really industry-worthy. For a few of the processes described I really got a déjà-vu feeling since the process incorporated stuff I had to implement in the past in a similar way. So no academic reasoning or constructs in this book! (which is surprising, given the authors).
Con
- The book is pretty short (about 180 pages) and in the end, I had the feeling there could be more to it. However, purely seen as an introduction to BPMN, the book is perfect.
- Like I said, the book is a perfect entry-level book, but if you want to do some real process modeling, you’ll definitely need to read up on some more advanced stuff and get some practical experience. However, you are well prepared for this journey with the bagage from the book.
- I ordered the book through Amazon and had to pay an extra import tax (only Amazon US had the book in store at the time I ordered) of 10 euro. So since the book only counts 180 pages, every page costs about 20 eurocents. In my opinion, that’s a bit too much. I think the book is perfect for an e-book, so I rather would have bought it in that format.
Conclusion
I liked reading the book and I finished it with only one pause between the reads. Taking into account that in fact the book describes a specification, this definitely is a good sign. The information covered in the book is limited, but in the end you get all the basics of BPMN and are ready to take on simple business procesess. The book uses examples from the industry and comes with a handy reference poster. In my opinion, the target audience of the book are managers or developers/analysts who need an introduction to BPMN.
If the Potsdam researchers are publishing an (e-) book about BPMN 2.0 in the future (perhaps now Tom is already married and teaching BPMN to his children …) , I’ll definitely give it a read!






