Camunda — Developer friendly BPMS

Ruslan Gainutdinov
Sep 10, 2018 · 6 min read

Here is the short introduction to Camunda BPM (https://camunda.org/) from the developer point of view. It is a blog post about the presentation I`ve made at TechWeeklies in Futurice, my current employer.

Workflow and decision automation

Introduction to workflow automation

Maybe it sounds too enterprisey, but it is a piece of technology which allows you to separate your frontend + APIs from business artifacts like processes, rules, and roles.

It is not applicable to every project out here, but if your project has:

  • Process oriented, i.e., you have workflow of managing things like documents, requests or applications between multiple users, APIs, frontends and systems.
  • Lots of different processes, multiple roles, and integrations between systems
  • Long-lived processes, i.e., process spans days, months, even years.
  • Processes defined by business (customer, analysts) and frequently change along with rules and roles

you might benefit from using BPM methodology.

Introduction

What is Business Process Management

  • Methodology to manage (identify, monitor, improve) processes “independently” from apps, code, and infrastructure
  • Define how you make decisions during the process — decision rules
  • Understand roles (groups of users)
  • Identify services (APIs and integrations)
  • Design user interfaces (web, mobile)

What is BPM, BPMS, BPM Suite, engine?

  • BPM — Software methodology. Ways of doing discovery, definition, control, and analytics of processes
  • BPM Suite — Everything is included (processes, decisions, security and UI editor). Sold as “no programmer required”, “business analysts do all the app”, “low code” and other myths for $$$$ amount (IBM BPM) or OSS with the freemium model (Bonita BPM)
  • BPM engine — an embeddable framework for building apps which use BPM. Notable examples: Activiti BPM, jBPM, Camunda BPM
  • BPMN — Business Process Management Notation — XML based format for defining processes and visual language to represent it. Examples of standalone editors: https://bpmn.io, Camunda Modeler, Yaoqiang BPMN Editor
  • Not a BPM but workflow automation: Pega Systems’ Pega Platform
  • Not a BPM but rule & decision management: RedHat Drools OSS, IBM ODM, FICO Decision Management Suite, Experian Transact SM

Why do I need to use BPM?

Business process management usually operates two tightly coupled principles — workflows and rules

Workflows

BPM systems allow you to define workflow visually by using standardized building blocks called BPMN (see Camunda BPMN documentation for detailed explanation)

BPMN allows you to implement essential non-functional bits of a high-quality distributed system:

  • Retries
  • Error handling (compensation)
  • Workflow metadata collection
  • Parallel processing

and more…

Rules

There are some ways people are usually following to implement business logic. It usually involves code and database tables to hold frequently changed rules, data and “constants”.

The drawback of embedding rules in code

  • Not transparent (can be seen and explained by developers only)
  • Difficult to change (need to commit and deploy)
  • No versioning (without custom approach, after deploy, all app start using new rules)
  • No history of process execution

The drawback of embedding rules in the database

  • Schema change if rules change
  • Multiple different tables
  • Need to orchestrate tables by code
  • Not part of the codebase (not testable)
  • Need to create custom editor UI

Declaring rules as DMN table

Camunda and Decision model and notation allows defining rules as a domain-specific, highly customizable table

By combining these DMN tables you can create easy to use, powerful decision making process.

Why Camunda?

Granted there is a lot of choices available when you consider open-source BPMN engine for your app (all of them in Java though) — Activiti BPM, jBPM, Camunda BPM. But there are great things about Camunda BPM you should consider:

  • Made in Berlin
  • Good support in Github Issues (I tested it myself, the issue was actually promptly fixed)
  • Modern Java 8
  • Spring Boot2 compatible (but you can run it differently — container, Java EE app, etc.)
  • Docker support + it does scale
  • Microservice architecture compatible
  • Swagger / GraphQL + bring your own APIs (fluent builder style Java API on top of which you can create REST APIs yourselves)
  • Embeddable, online and desktop modeler/editor
  • Customizable
  • Processes are unit testable
  • Great docs — BPMN & API

Camunda BPM components

Online, embeddable and desktop editor

Javascript based, awesome editor available for BPMN. If can use it standalone and with or without Camunda BPM engine, if you like.

Also available in the cloud at https://bpmn.io

It is based on open source NodeJS package — https://www.npmjs.com/package/bpmn-js

BPM Engine

Java8+ engine which can be integrated into the Java application. The recommended way to do it is use Spring Boot2, but you can also use Java EE or WAR deployment to the application server.

Camunda Cockpit

Spring Boot2 default application packs a number of embedded web applications which help you monitor and execute your processes.

Cockpit — control how your processes are executed and can see which processes executed now.

Camunda Tasklist

You can use it to start processes and execute user tasks without dedicated UI written.

Best practice infrastructure for Camunda BPM

Utilizing microservice architecture it is easy to run Camunda engine as REST/GraphQL API in docker.

Sample application

For presentation and this blog post, I`ve created example application with simple process and rule decision table:

This application illustrates all important topics:

  • Camunda engine
  • Camunda web applications
  • Authorization
  • Deploying processes and rule decision tables
  • External service tasks
  • Unit testing the processes
  • SwaggerUI for APIs (both app-defined and Camunda REST)
  • Launchpad — page with all the components accessible

To run it, you need Java8 and Maven installed.

Update (2019–04–14)

Try to run Camunda in 5 minutes by using Google Cloud Run, see my next article:

Links and further reading

Ruslan Gainutdinov

Written by

Tech Lead & Software engineer with a passion for #DevRel, Serverless, Java, and Javascript. https://ruslan.org