Search this Blog

Search this Blog


Follow our Blog by Email

Tuesday, February 17, 2015

Feedback wanted: Camunda BPM and Business Rules

Have you ever used the business rules task in BPMN?
Are your company's business rules closely related to your processes?

Many of our users will answer these questions with a 'yes'.

With the new DMN standard for decision management and business rules being close to the final release at OMG, the whole topic has recently been getting increased attention. The DMN (Decision Model and Notation) standard has been built in a way so that it can easily interact and integrate with BPMN.

Camunda BPM is widely considered a great BPMN engine. We have recently added the CMMN standard for case management to this engine, which was a great success for our users. Now we are thinking about adding a solution for executing business rules based on DMN.

We want to give you the chance to influence our decision, so that we build what you need most.

This is why we are asking you to participate in our survey. It's just 10 questions, won't take longer than 10 minutes and doesn't require any personal data. Please participate, even if you do not know DMN or if you do not care about business rules.

English version:

German version:

Thanks for taking part and for helping us decide. 

Monday, February 9, 2015

{ "json" : "everywhere" } - How to use json in a process

Since Camunda BPM platform 7.2 it is very easy to read, write and manipulate json objects by using Camunda Spin. Among other things, this feature is used to serialize Java objects inside a process instance in the process engine.

But what if you want to use Json Variables without mapping to Java objects? With the next alpha release we will introduce a new ValueType "json" (and "xml" but that is an other story).

In this post I demonstrate how you can use the json value type to

  • implement HTML Forms which work with a Json Variable,
  • implement BPMN Sequence Flow conditions based on the properties of the Json Variable.

Example Process

In this post I use the following example process:

Create a Json variable in a start form

The process instance is started by using a plain Html form inside camunda Tasklist.

  <form role="form" class="form-horizontal">
    <script cam-script type="text/form-script">

      var customer = $scope.customer = {};

      camForm.on('form-loaded', function () {
        // declare a 'json' variable 'customer'
          name: 'customer',
          type: 'json',
          value: customer

    <div class="control-group">
      <label class="control-label" for="firstName">First Name</label>
      <div class="controls">
        <input id="firstName" class="form-control"
               type="text" ng-model="customer.firstName" required />

    <!-- Additional fields omitted -->


The custom java script creates a new object and binds it to the angular $scope of the form as a variable named customer. Then a new process variable named customer will be created when the form has been loaded successfully. The type of the process variable is set to json, so that the variable will be persisted simply as json without the need to deserialize it to a custom Java object.

The form itself is a plain angular form (see ng-model binding of input field).

Accessing an existing Json variable in a task form

An existing json variable can be accessed using custom java script. The pattern is to fetch first the value of the variable and then bind it to an angular scope variable:

  <form role="form" class="form-horizontal">
    <script cam-script type="text/form-script">

      camForm.on('form-loaded', function () {
        // tell the form SDK to fetch the json variable name 'customer'

      camForm.on('variable-fetched', function () {
        // work with the variable (bind it to current angular $scope)
        $scope.customer = camForm.variableManager.variableValue('customer');

    <div class="control-group">
      <label class="control-label" for="firstName">First Name</label>
      <div class="controls">
        <input id="firstName" class="form-control"
               type="text" ng-model="customer.firstName" required />

    <!-- Additional fields omitted -->


Accessing an existing json variable in an expressions

In the past you could already store Json as variable values. However, you needed to store it as a String variable. The problem with that is that in a sequence flow you cannot easily write EL Expressions using the properties of the json if it is stored as a String.

In Camunda 7.2 we introduced Spin and it became possible to pare the String within El and use the Spin API for formulating conditions:

  ${ JSON(customer).prop("age").numberValue() >= 21}

While this was a huge improvement the problem is that if you need to interpret the same variable as Json multiple times within a command, it needs to be parsed multiple times (among other downsides).
Now that we introduce Json variables as native ValueTypes, you can directly access the properties of a Json variable in conditions:

    <sequenceFlow id="SequenceFlow_4" name="age >= 21" sourceRef="ExclusiveGateway_1" targetRef="UserTask_2">
      <conditionExpression xsi:type="tFormalExpression">
        <![CDATA[${customer.prop("age").numberValue() >= 21}]]>

    <sequenceFlow id="SequenceFlow_5" name="age < 21" sourceRef="ExclusiveGateway_1" targetRef="UserTask_3">
      <conditionExpression xsi:type="tFormalExpression">
        <![CDATA[${customer.prop("age").numberValue() < 21}]]>

The example resources can be found here.

Thursday, February 5, 2015

Data mapping and transformation with Camunda Spin and Java 8

Working with text based data formats such as Xml and Json is a common requirement when implementing BPMN processes.

Since version 7.2 Camunda provides an optional library which is called Camunda Spin. Spin is a lightweight wrapper library which provides a easy to use API when working with text based data formats such as XML and Json.

In this post I show how the Camunda Spin can be used for implementing data transformations and mapping in combination with the Java 8 Stream processing API and contrast this to the classical Java 6 / 7 way of doing it.

Tuesday, February 3, 2015

The symbiosis of test and documentation

We want to build a library of reusable widgets, which are tested and documented. The components of the tasklist search are examples for such widgets:

This blog entry describes how we document and test widgets and make sure that tests and documentation stay in sync.

Monday, February 2, 2015

Gracefully Cancelling a Process Instance

Cancelling a running process instance in Camunda is easy:
DELETE /process-instance/{id}
or, using Java API:
RuntimeService.deleteProcessInstance(String, String)
this will simply delete the process instance and remove it from the database. Sometimes this is exactly what you need.

However: what if you want to cancel the process instance gracefully? Gracefully in the sense that the effects it has had on the outside world are undone? The answer to this is compensation. In this post I discuss two ways to implement compensation.

Tuesday, January 27, 2015

Camunda BPM 7.3.0-alpha1 released

The first alpha release in the 7.3 branch is ready! This is what's inside:

  • New Documentation
    • Case Management Getting Started Tutorial (Docs)
    • Multi Tenancy (Docs)
  • Process Engine
    • Features
      • Namespaces in XPath (CAM-2342)
      • Typed Variable API in CDI Module (CAM-3152, contribution by Michael Scholz)
      • Support for CMMN Manual Activation Rule (CAM-3169
      • Use BPMN Call Activity for starting a CMMN Case Instance (CAM-3353)
    • Bugfixes
  • Cockpit
    • Maintenance
      • Upgrade to Bootstrap 3 (See "Known Issues" below)
      • Switched from Angular UI to Angular Bootstrap (See "Known Issues" below)
      • Support for requirejs-angular-define deprecated
    • Features
      • Improved startup time: All Javascript resources are now minified (including plugins)
      • Advanced Process Instance Search (CAM-2697, enterprise edition only)
  • Camunda Tasklist
    • Features
      • Create a standalone task
      • Support custom libraries providing custom angular controllers and other components. (Docs)
      • Support for plugins (Docs)
All together, 75 issues were closed. Read the complete release notes in JIRA.

Camunda BPM is open source and can be downloaded from

Wednesday, January 14, 2015

Camunda 7.2 Hands-on Webinars: Recordings available

Camunda 7.2 is packed with new features, which is why we just ran a series of developer-oriented webinars about the most important ones.

We hope you like what we built! The best way to let us know what we can do in order to provide you with the best BPM technology in the universe is to

Thank you so much! 

Recordings in English

Slides in English

Recordings in German