Thursday, March 1, 2012

Reward system demo

In the webinar I did last week, I showed a demo that creates a simple reward system where employees can give rewards to each other (that then need to be approved by HR).

The demo shows how to create a new application from scratch using a clean setup (using the latest jBPM installer) where a business user and a developer work together to create the business process. We then generate the necessary JUnit tests and task forms for this process, deploy it to the Guvnor repository and execute it on the jBPM console.

The demo is now available as six small screencasts.

In the first video, a business user uses the web-based Designer (that is integrated into the Guvnor repository) to create a rough, first version of the process.
  • The business user defines that first someone from HR should approve (or reject) the request
  • The process should then send an approval email to they employee if the request was approved.
  • The developer can then import this process into his Eclipse workspace.

The second video shows how the developer edits this process and adds all the necessary details to make it fully executable.

The third video shows how a JUnit test can be generated from the process definition to test the process.
  • The developer generates a JUnit test for the process (see last part of the second video)
  • He then fills in some of the data that needs to be passed to the process
  • The test executes successfully

The fourth video shows how forms (a process form to start the process and a task form to approve requests) are generated from the process definition and customized a little.

The fifth video uploads all these files onto the Guvnor repository and builds them so they can be used in production.

Finally, the process is executed in the jBPM console, where we start a new approval process and let someone from HR reject it.

You should be able to reproduce this yourself completely, simply by following the steps in the video. Hope you all like it !


  1. Nice showcase of the technology! We would like to try ourselves, but doesn’t seem to work with What version/snapshot did you use in your demo?

  2. Jim,

    Some of the features were not yet available in the jBPM 5.2 release. These will be available in the 5.3 release, or you can currently use the snapshot releases of the different components.


  3. Kris,
    Does JBPM 5.2 engine support BPEL language ?My intial understanding was it supports only BPMN 2.0 , but i read somewhere that it internally uses riftsaw for BPEL, is that true?
    This question, as i am evaluating BPM which support both BPEL and BPMN .

    1. jBPM does not execute BPEL. You could try to translate your BPEL to BPMN2 and then execute this, but we cannot execute it directly. If you're looking for a BPEL engine, the RiftSaw process in JBoss has support for that. It shares some of the components (e.g. BPM console) and vision, but they currently are separate engines.

  4. Tests have to be as quick as possible. Otherwise programmers avoid them. This showcase scares me little bit since the test last over 60 seconds.

    1. Yes, this was recorded on a very old desktop machine (with <1G memory) as my laptop crashed that week, which proved not enough for running all apps together :) The tests should only take a few seconds to initialize on a recent machine.

  5. Hey Kris, I'm new to jBPM and I've been following along your blogs. This one in particular was extremely helpful in putting it all together.

    However, I've tried without success to reproduce the result in screencast #3. All I get when I run the JUnit is this:

    Executing work item WorkItem 2 [name=Log, state=0, processInstanceId=1, parameters{Message=Reward for ${employee}: ${outcome} (${reason})}].

    I'm not able to get that template filled up with real-life values and I'm simply not getting that second line in your output with the mail contents. Am I missing something? Can you please help me here?

    1. And oh, in case it matters, I'm running jBPM 5.3.0 on Ubuntu.

    2. Sorry, scratch that. The issue here was I was using $ in parameter names instead of #.

      But there's another issue I'm now facing: I'm not able to get the outcome and the explanation values to be set (they are probably being set to empty strings) because of which the mail doesn't get sent either. I had another friend try this out who's running into the same issue. Is this a bug in the Eclipse plugin or again something we're both doing wrong?

    3. Hi Prashant,

      Just want to let you know that I'm running into the same issue while testing this tutorial out.