maandag 30 juli 2007

Configuring Tasks in the jBPM jPDL Graphical Process Designer

So here I am again with a continuation of my promised series of articles. I have been occupied last month, fixing bugs and cleaning out some of the code of the jBPM jPDL Graphical Process Designer (GPD), resulting in the release of a second beta last weekend. Particularly interesting about this release is the reintroduction of Seam pageflow.
For this entry, I want to focus on the jBPM task support. Tasks are in fact one of the strong features of jBPM and it will take more than one article to treat them fully. For now, let's keep things simple and start with a slightly modified version of the process we used in the previous entry.

As you can see, the process definition contains three nodes: a start state, a task node and an end state. The focus of the discussion will be on the task node. This type of node is actually a special kind of wait state. The difference with a normal wait state is that the execution engine will create task instances when it enters a task node. The number and type of task instances that are created depend on the task definitions that are configured on the task node. You can inspect these configured task definitions by selecting the 'Task' tab in the tabbed properties view when a task node is selected.

In order to create a task definition, either use the popup menu shown above or the button on the property views action bar. A task has a fair number of configuration possibilities. You can either select the target task definition directly in the outline page of the editor and access the properties through the tabbed properties view or else select the target task in the treeview of the 'Task' tab of the containing node. If you do the latter an embedded tabbed form will appear, with tab pages for the different categories of properties.

On the 'General' page, you can specify a name for the task as well as a description.

The 'Details' page is already somewhat more complicated. The due date is a mandatory property for the task. All the other ones are optional. The due date is of course the date on which the task should be accomplished. For this example, the set due date is 2 business days. The priority is set to high and the signalling and notification attributes are set to true. This means respectively that the process will continue when the task is accomplished and that the assignee will be notified by email when the task is assigned. The blocking attribute indicates that the process will not be able to continue if this task is still unaccomplished. The purpose of the 'Generate Form...' button on this page is to create a simple task form that can be rendered by the jBPM console. Form generation and customization will be treated in another article.

The 'Assignment' page allows to specify how this task should be assigned. We will talk about the details of assigning tasks and swimlanes in a later article and for now simply assign this task to the actor id 'Bruce'.

The 'Reminder' page is the place where you can specify whether the assignee will be reminded of the task that awaits him. In this particular example the assignee will receive an email after 2 business hours and this email will be resent every business hour after that.
So what does all this configuring do behind the scenes? It creates a bunch of xml of course, that you are able to see in the final screenshot below.

So far for this second article. If you are eager to try our new release download it here. As always, we welcome comments and ideas on our forum and bugreports and feature requests in our JIRA. Also note that this latest release has been built with Eclipse 3.3 which you also might want to download.

Have fun,
Koen