What are you looking for?

Camunda BPM 7.3.0-alpha2 released

By
  • Blog
  • >
  • Camunda BPM 7.3.0-alpha2 released
A new alpha release of our open source BPM and Workflow platform is available for download. The highlights of this release are:

  • Process Engine and Rest API
    • Native JSON and XML Variable Value Types
    • Improved Sorting: specify multiple sort parameters in Rest API, sort task by variable value
    • Historic Job Log
    • Support for databases: Oracle 12c
    • Partially Order Historic Activity Instances by occurrence
  • Cockpit
    • UI improvements
    • Advanced Process Instance Search (enterprise feature)
  • Tasklist
    • Sort by multiple parameters
    • Sort by variable value
  • Admin
    • Browse Users by Group
  • JavaScript SDK
    • Add group resource
    • Support local variables
The full release notes can retrieved from Jira. The known issues as well.

Run this Release with Docker

If you want to run this release with Docker, you can use the freshly baked Docker images. The following command line will start the tomcat distribution:

docker pull camunda/camunda-bpm-platform:7.3.0-alpha2
docker run -d --name camunda -p 8080:8080 camunda/camunda-bpm-platform:7.3.0-alpha2

Open browser with URL: https://localhost:8080/camunda/

See the Camunda Docker Images project for alternative distributions and versions.

Native XML and JSON Variable Types

This feature allows you to work with Xml and JSON variables in a “native” way, in both the Rest Api and the Java Api.

Assume you have the following JSON Document:

{
  "customerId": "SFAS-342434",
  "revenue": 3324.43,
  ...
}

Then it can be stored as JSON variable in the following way:

import static org.camunda.spin.plugin.variable.SpinValues.*;

// assuming the json document is available as string variable
String customerData = ...;

// set the customer as json variable of a process instance
runtimeService.setVariable(pid, "customerData", jsonValue(customerData));

The important part is the jsonValue(...) method. It tells the process engine that the provided string should not be interpreted as a string but as a JSON value. What is the benefit?

First, the value can be of arbitrary size (while the max character size for string values is limited).

If we request the variable in expression language (when implementing the condition of a sequence flow), we can directly access the properties of the JSON object:

<sequenceFlow name="vip customer" sourceRef="..." targetRef="...">
  <conditionExpression xsi:type="tFormalExpression">
    <![CDATA[
      ${ customerData.prop("revenue").doubleValue() >= 10000 }
    ]]>
  </conditionExpression>
</sequenceFlow>

Note how we can directly access a property of the JSON object in customer.prop("revenue").

How is this possible? The process engine internally uses the Camunda Spin library for parsing the JSON value with Jackson and providing a lightweight wrapper over the Jackson API, optimized for fluent API access.

You get the same benefit if you request the variable from java code:

public class ProcessCustomerData implements JavaDelegate {

  public void execute(DelegateExecution execution) {
    JsonValue customerData = execution.getVariableTyped("customerData");

    double revenue = customerData.getValue().prop("revenue").doubleValue();
  }

}

Note that if the same variable is requested multiple times in the same command, it will only be parsed once.

In case you do not need a parsed representation, you can also request the serialized (string) representation:

JsonValue customerData = execution.getVariableTyped("customerData", false);    
String valueAsString = customerData.getValueSerialized();

For this feature some documentation is still missing but you can already read Roman’s Blogpost and checkout the example on GitHub.

Sort Tasks by Variable Value

When querying for tasks, it is now possible to sort by variable value:

taskService.createTaskQuery()
  .taskAssignee("jonny")
  .orderByDueDate().desc()
  .orderByTaskVariable("invoiceAmount", ValueType.DOUBLE).desc()
  .list();

The same can be done in the Tasklist as you can see here:

sorting task by process variable in tasklist

Advanced Process Instance Search

We added an enterprise feature to Cockpit which allows searching for process instances with complex criteria:
screenshot of the Advanced Process Instance Search in cockpit

The most awesome things are yet to come!

We have amazing things in the pipeline. On current master it is already possible to do this:

List executions = runtimeService.createExecutionQuery()
  .processDefinitionKey("invoice")
  .activityId("selectAssignee")
  .list();

for (Execution e : executions) {
  runtimeService.createProcessInstanceModification(e.getProcessInstanceId())
    .cancelAllInActivity("selectApprover")
    .startBeforeActivity("approveInvoice")
      .setVariable("approver", "jonny1")
    .execute();
}

And that is just the beginning… :=)

Try All Features of Camunda

Related Content

Improve customer satisfaction while transitioning to an entirely different energy system? Not a problem with Camunda's Self-Managed migrations.
How to avoid pitfalls and make the most of FEEL for a citizen developer.
How to avoid pitfalls and make the most of FEEL for a seasoned software developer.