dinsdag 14 december 2010

Eclipsing BPMN 2.0

Most of us that are following the BPM area are aware of the BPMN 2.0 standard that was finalized recently. This new version of the standard has received a lot of attention and is a candidate that has a good chance to be able to unify the fractioned landscape of BPM. The standard specifies among others the notation to use to model processes and choreographies, the format to use when serializing them and how the models are to behave when they are executed by a BPMN engine.

The first of these goals implies that a BPMN 2.0 practitioner can use a tool to create the BPMN 2.0 models that uses the specified notation. During the last months I have worked intensively to create such a graphical BPMN 2.0 editor that would produce models that can be executed on the brand new jBPM 5 runtime. Today I am happy to present you the fruit of this hard work. The focus of this article is user-centric. I will shine a light on the implementation hurdles I encountered in another post.

Overview

As the title of the article implies, the editor comes as a series of Eclipse plugins. The screenshot below shows a general impression of the result after recreating the 'evaluation' example from the jBPM 5 documentation.


Installation

You can download the installable archive from our development community pages. The downloaded file is an archived repository that you can install into Eclipse using the familiar 'Help->Install New Software...' mechanism. The procedure is illustrated on the next two screenshots.


Make sure that the checkbox 'Group items by category' is unchecked as you will not see any features to install on the next screen otherwise. If all is going well, you should see two 'BPMN 2.0 Tools' items on the next page. The first item of these contains the binaries of the plugins that will be installed, the second contains the source code bundles. Just select both of them and push the 'Next' button.


The rest of the installation is pretty straightforward. You only have to accept all the defaults as you work yourself through the wizards.

BPMN 2.0 in Perspective

After installing the plugins and restarting Eclipse, you can do a first verification if all went well by trying to switch to the BPMN 2.0 perspective. To do this you can push on the 'Open Perspective' button in the top right location of your Eclipse workbench, select 'Others...' as illustrated below and choose the 'BPMN 2.0' entry in the list that opens.


As you can see, the workbench has now a number of opened views such as the 'BPMN 2.0 Definitions' view and the 'BPMN 2.0 Details' view which you might not yet be familiar with. We will explain shortly what purpose they serve. Next to these views, the usual 'Package Explorer' view, 'Property' view and 'Outline' view are open.

Working Towards the Flow

Before we can start creating our first BPMN 2.0 process, we need to create a project. In this case any simple project will do, so we will create a resource project called 'foo'. By bringing up the context menu when this project is selected and selecting 'New->BPMN2 Diagram' we can create our new process.


We choose for example the name 'bar.jbpm' for our process resource and the BPMN 2.0 process diagram editor opens.


Hello, BPMN 2.0 World

Let's create a simple three node "hello, world" like process that is started off by the reception of a message and subsequently writes out the message. I have recorded a little screencast of the creation of this process to show you some of the more advanced features that the editor inherits by being based on the Eclipse Graphical Modeling Framework (GMF): the popup toolbar, the connection handles and the layouting mechanism.


As you can see this goes really smoothly. Of course I knew where on the toolbar and in the dropdown menu the different tools that I needed were placed. Also you might not be very impressed with the bareboned icons. These icons are inherited from the underlying Eclipse BPMN 2.0 Model project that was used as the base for the editor. The good news is that it is not so hard to replace these icons and that the creation of nice icons is in the hands of the real specialists in this area (see this JIRA issue). And even if you don't know exactly where on the toolbar you need to click, you are still free to use the palette...

The Source is With You

As I have mentioned before, one of the particularities of the BPMN 2.0 specification is that it describes by means of a number of xsd's how to serialize the modeled processes. Also the serialization of the graphical information is handled by the specification. The solution I present here to you is completely in line with this specification. The semantic model and the graphical information are serialized in one single file in a way that is compliant with the specification.

You can see the serialized XML by saving the work we did until now and opening the 'bar.jbpmn' file by choosing 'Open With->Text Editor'. The result should be similar to what is shown below.


One of the obvious feature requests that you could think about is to integrate the BPMN 2.0 graphical editor with an XML editor to provide a source page in a multipage editor.

Making the Flow Work

The process now is what is called underspecified. If you would deploy it on a compliant engine this engine would not be able to execute it. To make it executable, we have to provide some details. One of the ways to do this would be to edit the XML source in your preferred text editor, but luckily the BPMN 2.0 Diagram Editor provides a complete solution that makes adding these details a breeze. The two key elements that enable this are the BPMN 2.0 Definitions View and the BPMN 2.0 Details View.

The screencast below shows how the Definitions View is used to add two item definitions and one message. The Definitions View contains elements that are global for the entire BPMN file. Next the Details View is used to add a property to the process, to specify the output set, data output and data output associations for the start event as well as the script property for the script task. The Details View, as its name implies, provides a way of specifying details for the currently selected graphical element in the editor.


These additions should make the process executable and fully specified. Showing how to execute this process on the jBPM 5 runtime would make this entry too long, so I will save it for later.

Knowing the Issues

While the editor is fully usable to create executable BPMN 2.0 files, there is definitely room for improvement and for additional features. The following list contains some of the known problems that are must haves to make the editor really complete from a BPM 2.0 point of view:
  • As already mentioned, the graphical icons should be made more attractive. Luckily the hard part of this is actually designing the icons and this is exactly the task that we leave into the hands of our specialist graphical designers.
  • There are issues with the bendpoints. These are not always reproduced at the same location after closing and reopening the editor. The way how GMF determines bendpoints and anchor points is not yet completely clear to me. Any input in this area is greatly appreciated.
  • Attached events are not yet supported. Luckily again, this is just a matter of enriching the GMF model and regenerating the graphical part of the editor.
  • Swimlanes are not yet supported.
A list of features that would be nice to have is also not very difficult to come up with:
  • Add a generic activity type mechanism that users can use to add domain specific extensions.
  • Provide a way to annotate nodes on the diagram so that the editor can be used in 'debugging mode' or simply can show errors.
  • Add support for multiple process diagrams in one file by providing one tab for each process in the file.
  • Add a optional source tab.
  • Create a choreography diagram editor.
  • ...
Most of these features should not be that difficult to add.

Conclusion

While the BPMN 2.0 process diagram editor in its current state is far from perfect, I think it provides already enough features to create fully specified processes that can be executed on BPMN 2.0 engines that provide execution compliance. If you are a BPM practioner and/or developer, I encourage you to make use of it and provide us with your feedback!

Best regards,
Koen