What are you looking for?

More From Camunda BPM: Java External Task Client & BPM Assert

Alongside our Camunda BPM 7.14.0 release, we’re excited to announce External Task Client 1.4.0 for Java and BPM Assert 8.0.0
By
  • Blog
  • >
  • More From Camunda BPM: Java External Task Client & BPM Assert

Alongside our Camunda BPM 7.14.0 release, we’re excited to announce the following releases:

You can read all about the Camunda BPM 7.14.0 release in the dedicated blog post.

Java External Task Client 1.4.0

The External Task Clients help you to decouple your services from the Workflow Engine – a common use case, for example, in microservices architectures. We’ve released version 1.4.0 of our Java client.

Receive Local Variables in Fetch & Lock

Using process variables in External Tasks is a handy feature to transfer data from the process engine to external workers and vice versa.

With the latest version of the External Task Client, you can easily fetch local variables of a task – instead of fetching all accessible variables. You can do this by using the new localVariables operation on the topic subscription builder:

client
  .subscribe("topic")
  .localVariables(true)
  .handler(topicHandler)
  .open();

This feature has been around in the REST API already by setting localVariables to true in such a request and can now also be used directly in Java with the External Task Client.

Fetch Extension Properties

The External Task Client now allows you to fetch extension properties – this works well with using the extension properties to send additional data to the task worker – introduced with Camunda BPM 7.14.

This helps you to achieve a fine-grained separation of concerns when it comes to the data flows. You can read more details in our release blog post.

Here is how it works:

<bpmn:serviceTask id="orderPizza" name="Order Pizza" camunda:type="external" camunda:topic="createOrder"> 
  <bpmn:extensionElements>
    <camunda:inputOutput>
      <camunda:inputParameter name="type">${pizzaType}</camunda:inputParameter>
      <camunda:outputParameter name="orderId">${createdOrderId}</camunda:outputParameter>
    </camunda:inputOutput>
    <camunda:properties>
      <camunda:property name="defaultVendorId" value="1034" />
      <camunda:property name="cancelExistingOrder" value="true" />
    </camunda:properties>
  </bpmn:extensionElements>
</bpmn:serviceTask>

In order to fetch those properties, you can use includeExtensionProperties with the topic subscription in the client:

client
  .subscribe("topic")
  .includeExtensionProperties(true)
  .handler(topicHandler)
  .open();

The topic handler will be able to access the extension properties from the locked External Task by using getExtensionProperties() to receive all of them or getExtensionProperty("propertyA") to fetch specific ones.

Asynchronous Task Handling

The External Task Client 1.4.0 allows you to use id-based operations with the External Task Service API, making it easy to handle external tasks asynchronous in external workers.

You can use the following operations by passing an external task id:

  • complete
  • handleFailure
  • handleBpmnError
  • extendLock

BPM Assert 8.0.0

BPM Assert helps you test your processes conveniently in Java. The latest release adds more testing and convenience features to make checking your processes quick and thorough.

We upgraded the version of AssertJ to 3.16.1, which is the current version used in Spring Boot 2.3.x and therefore also the latest Camunda Spring Boot Starter. You can read about version compatibility in our guide.

Check out BPM Assert on GitHub.

Multiple Jobs on Process Instance Level

Handling jobs in a process instance is a very common task when testing process models, e.g. to test on jobs’ status or drive the model by executing them.
With BPM Assert this is easy to do by using the static job helper methods of the ProcessEngineTests class like job(activityId).
This allows you to fetch jobs that are created for specific activities, e.g. the job resembling the asynchronous continuation of activity A in the following model.

In some cases, multiple jobs might be bound to the execution of the process instance at the same time. In the sample model depicted here, the job for the asynchronous continuation of activity A, as well as the one for the timer start event of the event subprocess will be bound to the same process instance.

With BPM Assert 8.0.0, we enhanced the job helper method job(activityId) to also handle such models correctly.
It will now return the job created for the provided activity id, given there is one for it in the current process instance under test.

Check out the user guide of BPM Assert for further guidance on how to use the provided assertion methods.

Register for the Webinar

If you’re not already registered, be sure to secure a spot at the release webinar. You can register for free here.

Your Feedback Matters!

With every release, we strive to improve Camunda BPM, and we rely on your feedback! Feel free to share your ideas and suggestions with us.

You can contact us via the Camunda user forum.

Try All Features of Camunda

Related Content

Transition from simple deployments to a fully integrated production setup smoothly.
We're excited to announce the November 2024 alpha release of Camunda. Check out what's new.
Announcing our new SAP integration: find out what inspired us to build the solution, how it works and what you can expect (hint: flexibility, speed and reduced risk).