BPMN Tutorial for Beginners

This tutorial introduces the essential features of BPMN 2.0. BPMN stands for Business Process Modeling Notation and is a public standard by OMG. It describes a business-friendly, flow chart-like graphical notation that business process analysts and business users can use to model business processes and has support for process interactions, exception handling, compensation semantics, and so on.

Both commercial and open source BPMS tooling vendors widely use BPMN for a set of reasons such as:

  • It is highly adaptable
  • It is able to capture everything from abstract process outlines to detailed process flows to implementation ready processes.

One of the main value propositions of BPMN besides being a diagram standard is the precise semantics behind the diagram. The shape, the symbols, the borders, the placement of the BPMN diagram elements, as well as their properties, have well defined meanings. Therefore we need standard tools to interpret them in the same manner.

Evolution of BPM Standards

Although BPMN 1.1 comprehensively addressed process modeling notations, it was substantially missing to address an interchange format (for diagram exchange). This resulted in implementation vendors adopting different standards (BPEL, XPDL, or JBPM’s JPDL) to store BPMN process models leading to not only a loss of portability across tools but also making it difficult to communicate across the various stakeholders.

Today, BPMN is the standard way to represent a business process although BPMN is not an island. There are different standards that complement your processes such as:

  • DMN is a modeling language and notation for the precise specification of business decisions and business rules. DMN can complement with process designed with BPMN
  • PMML is a standard to represent predictive solutions. You can include (PMML) models in a DMN file and invoke it as a boxed function expression for a DMN decision node or business knowledge model node.

BPMN vision

The vision of BPMN 2.0 is to have a single specification for notation, metamodel, and interchange. In addition, BPMN 2.0 has been expanded to include orchestrations and choreography of process models.
A Business Process Diagram is a simple diagram made up of a set of graphical elements that depicts a business process.

There are four primary elements of BPD:

bpmn 2.0 tutorial
  1. Flow Objects: represent the core elements of the business process diagram.
  2. Connecting Objects: which you use to connect the BPMN 2.0 core objects
  3. Artifacts: allow process designers to extend the basic BPMN 2.0 notation to include additional information about the process in the process diagram
  4. Swimlanes: are mechanism to organize activities and responsibilities on a process diagram.

BPMN 2.0 Flow Objects

As we said, Flow Objects are shapes that represent the core elements of the Business Process Diagram (BPD), including:

  • Activity: is any work that is being performed in a process.
  • Event: are anything that “happens” during the course of a business process.
  • Gateway: you can use it to control the flow of a process.

The following BPMN diagram depicts a sample BPMN 2.0 Purchase Process which includes a Start Event, some Activities, one Gateway and an End Event:

bpmn diagram

If you want to have visibility on which Role is in charge of a specific Task, you can use Swim Lanes. Here is for example how to depict the above Process using Swim Lanes:

bpmn 2.0

BPMN 2.0 Events

The biggest difference between BPMN 2.0 and traditional flowcharting is the support for events.  An event is a signal that something happened, and BPMN lets you say how the process should respond.
The Events can occur at the beginning (Start Events) or at the end (End Events) or in the middle (Intermediate) of the process.  Additionally, some events can happen on the Boundary of an activity.

A Boundary Event is an intermediate event, that is it can be triggered or thrown at any time while the associated task or activity is being performed.  Some boundary events are time-based while others are based on a condition which must resolve to ‘True’ in order for that branch of the flow to proceed.

The following picture depicts a BPMN diagram for ordering some products which includes a Start event (a message event), of an Intermediate error event, a Boundary Timer event, and two End events.
bpmn diagram

All BPMN 2.0 Events can also be classified as:

  • Catching events, which are events with a defined trigger. They are started once the trigger has activated or fired.
  • Throwing events, which are triggers for catching events and are triggered by the process.

The Start Events are always of catch type and the End Events are always of throw type. The Intermediate Events can be either of throw or catch type.There are various flavors of Events in BPMN 2.0. The Event Types are listed as follows:

bpmn 2.0 tutorial introduction quickstart eventsMessage EventSend or receive messages.
bpmn 2.0 tutorial introduction quickstart eventsTimer EventYou can use it to waiting for a specific time condition to evaluate to true.
bpmn 2.0 tutorial introduction quickstart eventsSignal EventYou can use it to publish and subscribe of signals.
bpmn 2.0 tutorial introduction quickstart eventsError EventYou can use it for exception handling and they can occur only at the end of the process.
bpmn 2.0 tutorial introduction example events quickstartTermination EventYou can add it to terminate the process and can occur only at the end of the process.
bpmn 2.0 tutorial introduction example events quickstartConditional EventYou can add it to start rule-based triggers.
bpmn 2.0 tutorial introduction example events quickstartEscalation EventYou can use it to handle escalation conditions (since BPMN 2.0).
bpmn 2.0 tutorial introduction example events quickstartCompensation EventYou can add it to to handle compensation in the process.

Depending on the combination of events, phase in which the event is triggered (Start, Intermediate, Boundary) and if the event interrupts an Activity, you can represent the event with a different combination of graphic notations.

BPMN 2.0 Message Events

BPMN 2.0 Message events are events which reference a named message. A message has a name and a payload and is always directed at a single receiver.
The graphical representation of the message can vary depending on the phase in which the message is sent/received
bpmn tutorial introduction example

Start Message Event

A process or an event subprocess can contain multiple message start events, which are triggered by a particular message.  A message has a name and a payload. Unlike a signal, a message event is always directed at a single recipient. The process instance with a message start event only starts its execution from this event after it has received the respective message. After the message is received, the process is instantiated and its message start event is executed immediately.

Because a message can be consumed by an arbitrary number of processes, one message can trigger multiple message start events and thus instantiate multiple processes.

Intermediate Message Event

A message intermediate event is an intermediate event that enables you to manage a message. Use one of the following events:

  • A throwing message intermediate event produces a message object based on the defined properties.
  • A catching message intermediate event listens for a message object with the defined properties.

End Message Event

When a flow enters a message end event, the flow finishes and the end event produces a message as defined in its properties.

BPMN 2.0 Timer Events

BPMN 2.0 Timer events are events which are triggered by defined timer. You can use it as start event, intermediate event or boundary event.

bpmn howto tutorial introduction essentials

Start Timer Event

The timer start event is based on a timing mechanism. A process can contain multiple timer start events, which are triggered at the start of the process. After that, the timing mechanism is applied.

Intermediate Timer Event

A timer intermediate event enables you to trigger or delay the workflow execution periodically. It represents a timer that can trigger one or multiple times after a specified period of time. When the timer intermediate event is triggered, the timer based condition is verified and the outgoing flow is taken. When the timer intermediate event is placed in the process workflow, it has one incoming flow and one outgoing flow. Its execution starts when the incoming flow transfers to the event. When a timer intermediate event is placed on an activity boundary, the execution is triggered at the same time as the activity execution.

End Timer Event

The timer is canceled if the timer element is canceled, for example by completing or aborting the enclosing process instance.

BPMN 2.0 Signal Events

You can include this event for sending or receiving Signals. A Signal is for general communication within the process components. A BPMN 2.0 Signal is similar to a signal flare that shot into the sky for anyone who might be interested to notice and then react. Thus, there is a source of the Signal, but no specific intended target. This is different than a BPMN Message, which has a specific Source and a specific Target (which can be an Entity or an abstract Role).
bpmn howto quickguide introduction tutorial

Start Signal Event

The signal start event is is triggered by a signal with a particular signal code. A process can contain several signal start events. The signal start event only starts its execution within the process instance after the instance has received the respective signal. Then, the signal start event is executed and its outgoing flow is taken.

Intermediate Signal Event

A signal intermediate event enables you to produce or consume a signal object. You can use any of the following options:

  • A throwing signal intermediate event produces a signal object based on the defined properties.
  • A catching signal intermediate event listens for a signal object with the defined properties.

End Signal Event

You can add a throwing signal end event to signal the end of a process or subprocess flow. When the execution flow enters the element, the execution flow finishes and produces a signal identified by its SignalRef property.

BPMN 2.0 Error Events

bpmn 2.0 tutorial introduction quickstart

Start Error Event

A process or subprocess can contain multiple error start events, which are fired when an error object (containing a particular ErrorRef property) is received. The error object can be produced by an error end event. It indicates an incorrect process ending. The process instance with the error start event starts execution after it has received its error object.

Intermediate Error Event

An error intermediate event enables the process to react to an error end event in the respective activity. The activity must not be atomic. When the activity finishes with an error end event that produces an error object with the respective ErrorCode property, the error intermediate event catches the error object and execution continues to its outgoing flow.

End Error Event

The throwing error end event finishes the incoming workflow, which means consumes the incoming token, and produces an error object. Any other running workflows in the process or subprocess remain uninfluenced.

BPMN 2.0 Compensation Events

Compensation is a means for “undoing” the effects of an action.

For example, supposing you have booked a ticket to a show at the beginning of your process, then a compensation could be cancelling the reservation.
bpmn events

Intermediate Compensation Event

A compensation intermediate event is a boundary event attached to an activity in a transaction subprocess. It can finish with a compensation end event or a cancel end event. The compensation intermediate event must be associated with a flow, which is connected to the compensation activity.

The activity associated with the boundary compensation intermediate event is executed if the transaction subprocess finishes with the compensation end event. The execution continues with the respective flow.

End Compensation Event

You can employ a compensation end event to finish a transaction subprocess and trigger the compensation defined by the compensation intermediate event attached to the boundary of the subprocess activities.

BPMN 2.0 Conditional Events

Real world business processes often embody complex decision making. You can, therefore, add conditional events for rule-based triggers which are in the process.

bpmn events

Start Conditional Event

The conditional start event is a start event with a Boolean condition definition. The execution is triggered when the condition is first evaluated to false and then to true. The process execution starts only if the condition is evaluated to true after the start event has been instantiated.
A process can contain multiple conditional start events.

Intermediate Conditional Event

A conditional intermediate event is an intermediate event with a boolean condition as its trigger. The event triggers further workflow execution when the condition evaluates to true and its outgoing flow is taken.

End Conditional Event

The event must define the Expression property. When a conditional intermediate event is placed in the process workflow, it has one incoming flow, one outgoing flow, and its execution starts when the incoming flow transfers to the event. When a conditional intermediate event is placed on an activity boundary, the execution is triggered at the same time as the activity execution. Note that if the event is non-interrupting, the event triggers continuously while the condition is true.

BPMN Best practices

Now that you have a basic exposure to BPMN, let’s check some common best practices when designing BPMN processes:

  • Make sure your BPMN diagram reflects the business logic.
  • Include labels on your Tasks, Gateways, Intermediate events or subprocess to make it human readable
  • Handle exceptions that can happen in the process and show how they are handled
  • Use a consistent terminology in your process. F.e. name your Human Task as “userX” and automated Tasks as “serviceY”
  • Use a verbal-noun format to describe your services (f.e. sendOrder, abortOrder)
  • To make easier to view the whole process, use a hierarchy or processes by including parent and subprocesses
  • Use Message Flows to show how two or more processes interact with each other in synchronized way (how they collaborate)

How to design a BPMN online

Do you want a quick head start with a BPMN Diagram? Simply head to the Kie Sandbox at: https://sandbox.kie.org/#/

This BPMN online tool allows to design BPMN Diagrams, Decision Models (DMN) and Scorecards (PMML files).

Also, you can import existing diagrams or models and export them when you are finishing it with editing. Give it a try!

The first part of BPMN tutorial ends here. In the next BPMN tutorial part 2 we will discuss about the other two Flow Objects: Gateways and Activities.