BPMN Support in Zeebe Through 0.16: A Quick Primer

by Mike Winters on Mar 19 2019 in Zeebe Resources.

Zeebe 0.15, released at the beginning of February 2019, shipped with new BPMN features, including message and timer start events and non-interrupting message and timer boundary events.

The Zeebe team has made significant progress on BPMN coverage in the last few releases, and when it comes to the near-term Zeebe BPMN roadmap, the 0.15 features are the last of what’s planned in preparation of a production-ready Zeebe release in mid-2019.

In the Zeebe documentation, we describe each supported BPMN element and its technical specifications. Especially if you’re new to BPMN, we recommend you consult the docs during the modeling process. Many important details are covered, from how to define duration for timer events to workflow instance dataflow.

Because we’ve added many new symbols in the past few months, we also want to write a post with a quick runthrough of the BPMN supported as of Zeebe 0.15 plus some simple guidance on the “business logic case” for each symbol.

Over the course of this post, we’ll introduce elements in a different order than what you see in the docs because we want to make it clear here how elements can build on each other and how combinations of different elements can be used to express complex business logic.

In addition to not being a replacement for the docs, this blog post is also not an in-depth overview of BPMN modeling best practices. That’s something we’ve not yet put together for Zeebe. But stay tuned – it’s on our radar.

If you want to be hands-on throughout the post, we encourage you to download the Zeebe Modeler and do a bit of modeling yourself.

A Few Things To Know About BPMN and Zeebe

First, here’s some background in case you’re brand new to BPMN.

For more background on BPMN and why it’s a fit for microservices orchestration, we recommend this blog post.

BPMN in Zeebe

Start Events

Every BPMN workflow must begin with a Start Event. In Zeebe, you can choose between:

The BPMN null start event.

The BPMN message start event.

The BPMN timer start event.

Tasks

Tasks in Zeebe are used to represent something that needs to be done before a workflow instance can progress to the next step. There are two different types of tasks supported as of Zeebe 0.15:

The BPMN service task.

The BPMN receive task.

Intermediate Catch Events

Intermediate Catch Events are used to model things that need to happen before our model can progress to the next step (as opposed to modeling work that needs to be done by a microservice, for which we’d use the Service Task). There are two types of Intermediate Catch Events in Zeebe.

The BPMN intermediate message catch event.

The BPMN intermediate timer catch event.

Gateways

Gateways are used to control the flow of a workflow instance token. A gateway can be used for parallel execution or to specify when a token should only take one of multiple paths. Zeebe currently supports three types of gateways:

The BPMN exclusive gateway.

The BPMN parallel gateway.

The BPMN event-based gateway.

Message and Timer Boundary Events

Message and Timer Events can also be attached to activities to either a) interrupt the activity to which the boundary event is attached and follow the sequence path out of the boundary event only or b) to create an additional execution without interrupting the activity to which the boundary event is attached.

The BPMN interrupting message boundary event.

The BPMN interrupting message boundary event.

Until now, the Receive Task and Intermediate Message Catching Event looked similar in terms of functionality. The ability to attach Boundary Events is a unique feature of the Receive Task. For example, if we haven’t received an expected message within a specified time period, we could trigger an escalation.

The BPMN boundary event with receive task.

Embedded Subprocess

A Subprocess is an activity that contains other activities, gateways, events, etc., which itself is part of a larger process. A Subprocess is completely defined inside a parent process, and that’s why it’s often called an Embedded Subprocess. In Zeebe, the primary use case for a Subprocess is to create a new scope for events.

Events that occur during execution of a Subprocess can be caught by a Boundary Event on the boundary of the Subprocess. For a different take on an order cancellation example, we might allow a customer to cancel an order as long as we haven’t yet completed the Ship Package task. We can use an Embedded Subprocess to express this logic.

The BPMN embedded subprocess.

Wrapping Up

While quite a lot is possible with the BPMN symbols supported in Zeebe through 0.15, we don’t consider our work on BPMN to be finished. We’re always listening for user feedback regarding symbols to support in the future. If you have input to share, please let us know.

To learn more about BPMN basics, the best place to start is the Zeebe docs. In addition, we’ve written a couple of other blog posts about BPMN and its role in microservices orchestration:

And be sure to let us know if there are other BPMN-related resources you’d find helpful as you work on your Zeebe project.