Tuesday, March 26, 2013

Using Camel routes in Activiti made really easy

As you know Activiti contained a Camel module already for quite some time. And in previous blog posts I showed it provides a really powerful combination of two great frameworks. In the Activiti 5.12 release we made the usage of Camel routes in Activiti even simpler (also thanks to Ryan for his community contribution here).

Before the 5.12 release you had to define a CamelBehaviour bean with a list of SimpleContextProvider beans to establish a relationship between a process definition and a camel context, like the following code snippet:

This is gone now in Activiti 5.12. By default the Activiti Engine will try to resolve a Camel context bean with the name "camelContext". And if you don't want to use this default Camel context you can override it in the Camel service task like this:
And in the this code snippet you also see another change from the previous releases. You can now invoke a Camel route by defining a service task with the type attribute value of "camel" instead of having to use a delegateExpression attribute.

So now let's look at a simple example of how to use the Activiti Camel module. Just add a Camel context bean definition to an Activiti Spring configuration file like this:

This will make any Camel route class in the package org.activiti.camel.route available to invoke from an Activiti process definition. Now let's implement a very simple process definition that invokes a Camel route and waits for a response message before ending the instance.
This corresponds to the following process definition XML:

So now we only need to define a couple of Camel routes to get this example fully implemented:

When the message is off-loaded to a SEDA queue in Camel the Activiti service task will complete and move on to the next receive task. In the meantime you can let Camel execute the integration logic you need, like invoking a REST or web service or invoke a legacy application via another protocol. When Camel gets a response back from the request, it will invoke the receive task in the Activiti Engine and the instance will be completed. Camel is able to find the right process instance, because the process instance id is added to the header of the Camel message by the Camel service task.

As you can see, it's really easy now to use Activiti and Camel together. Hope you'll see the opportunity of this and create some powerful process and integration solutions ;-)

Friday, March 22, 2013

Activiti Designer 5.12.0

I'm happy to announce the availability of the new 5.12.0 release of the Activiti Designer. This release contains a lot of usability improvements and re-introduces the import feature for diagrams that don't contain BPMN DI information and the linking of processes that use call activities. And of course this release contains also several bug fixes of issues reported in the Activiti JIRA.

Import of diagrams without BPMN DI

In one of the earlier versions of the Designer we had support to import BPMN XML files without BPMN DI information. We had to remove this feature after a big refactoring, but now it's back again! In the Activiti project we introduced a module name activiti-bpmn-layout which contains logic to do auto-layout for the process elements in a process definition and that's the module we're using in the Designer to create a graphical representation of a process definition which doesn't contain BPMN DI information. As you'll see, the auto-layout is not perfect, but it can create a very decent graphical view of most process definitions. An example is shown in the following screenshot.

Linking of processes for call activities

When you're using call activities it's very handy to be able to open the sub process with a simple button click, without the need to browse the explorer and find the sub process file yourself. So that's we added in this release of the Designer (thanks to Heiko). You can select the sub process from a list of processes that are retrieved from your workspace. When you have selected a sub process and the id of that process is unique in your workspace, you can now open the sub process with a simple button click (see the screenshot below).

Usability improvements

When you were browsing through the properties of an element in your process you probably have noticed that the Designer asks you to save your changes when closing the diagram later on. So event if you didn't make changes, the diagram was dirty. This is now fixed in this release. In addition, you had to define signals and messages separately on a process level and then you could select the specific signal or message event in for example a boundary or intermediary event. Because Activiti only requires you to define a signal or message id that can be used to identify the event, you can now directly fill-in this simple id in the boundary or intermediary event. No need to do this at a process level anymore. And you'll see a lot more bug fixes are part of this release.


You can get the 5.12.0 release from the http://activiti.org/designer/update update site or from the http://activiti.org/designer/archived archive site. And of course, all plugin projects are also available in the Activiti Maven repository. Hope you'll enjoy this release!

Monday, March 18, 2013

Activiti forked

I'm feeling a bit sad this morning with the fork of Activiti by Camunda. As you all know Camunda has been a community member of the Activiti project almost since the beginning and they made quite a number of good contributions over the years.

There are a couple of reasons that make me sad, one is that we didn't have any discussions recently and we didn't have any argument with each other. So we were very surprised when a couple of weeks ago we did a Skype call to hear that they decided to leave the Activiti community and start their own open source project (which is basically Activiti).

The second reason is from an open source standpoint, what's the gain to get here? The additional application server components would have fitted with the Activiti project also very well. So now we have two projects with the same codebase, which have to be maintained and futher developed. So twice the work without any real benefit for the open source BPM community.

The third and last reason is on a personal level. The Camunda developers are great people to work with and to have in the Activiti community. And it's sad to see them leaving for reasons I don't know or understand.

But enough said about that. Where does this leave the Activiti project? Well, as you saw in the recent 5.12 release we are more alive then ever before. We have a great community and a good number of contributors. New features for the 5.13, like a feature-complete REST API, a Javascript SDK, easier setup and administration are already under development and we'll release the Activiti Designer 5.12 very soon. So we'll keep on going strong and keep improving the Activiti components for our great community.

Friday, March 8, 2013

Activiti 5.12 JDK 6 bugfix

Although we are doing a lot of QA for every release of Activiti, we didn't fully test the Explorer functionality on JDK 6. In our Jenkins QA most of the jobs are running against JDK 7 for all our supported databases. But we also have a JDK 6 job that executes our full test suite to make sure we are JDK 6 compliant. But this doesn't include the Explorer app (yet). So due to a Xalan JAR and known XML JDK 6 issues the Explorer app didn't parse BPMN 2.0 XML files anymore without exceptions.

Thanks to our community we got notices of this very quickly and we started with fixing it immediately. For JDK 6 we had to disable safe BPMN 2.0 parsing (http://activiti.org/userguide/index.html#advanced.safe.bpmn.xml), but this can be easily switched on for JDK 7. In addition we also fixed an issue with the Activiti Kickstart module to deploy created process models (You can find this experimental functionality when creating a new model in the model workspace and choosing for the table editor BTW).

So now there's a new Activiti 5.12 release waiting for you on our download page, with a working Explorer application on JDK 6 and 7, Tomcat, JBoss 7 and the latest Glassfish. Also the Maven artifacts for the Engine, Converter and Explorer are updated. So make sure you remove any existing Activiti 5.12 JAR from your Maven repository so you get the latest JARs.

Thanks again for bringing up the JDK 6 issue so quickly!

Wednesday, March 6, 2013

Activiti 5.12 released

Yesterday, 5 March 2013 we released Activiti 5.12. This release is really packed with new features and improvements. These are the highlights:
  • Added new javascript-based diagram viewer to Explorer (thanks to Dmitry Farafonov)
  • Unified the BPMN parser and model for the Engine, Modeler and Designer
  • Added Activiti Kickstart to the Explorer to quickly create processes without deep BPMN knowledge
  • Simplified and extended the Activiti Camel module (thanks to Ryan Johnston)
  • Added first stage of reporting functionality to the Explorer via "reporting processes"
  • Added auto-layout module for Kickstart and BPMN import in Modeler (TBD) and Designer
  • Added script task and execution listeners
  • Lots of bug fixes
For a full list of improvements, features, bugs you look at the following JIRA issues.
In the next weeks we will blog in more detail about new features and improvements. Have fun!