DEV Community

Jeya
Jeya

Posted on • Updated on

How to get started with BPM Platform

If you want to understand how bpm workflow engine works and start writing your own workflows for any business use case, you are in the right place. At the end of this article, you will be able to have your own environment setup for workflow engine and sample BPMN.

Let’s get started!

What is BPM engine?

BPM or process workflow engine is a engine wherein we can orchestrate the set of tasks.

It provides BPMN (Business Process Management and Notation) which can be embedded in Java applications and with other languages via REST.
BPMN is visual modelling language for Business analysis applications. Using this, we can define our workflows in much more readable way.

In this article, we will be using BPM engine offered by Camunda.

Software requirements

  1. Camunda modeler: https://camunda.com/download/modeler/
  2. Camunda platform: There are different distributions for various application servers. In this tutorial, we will use Spring boot project distribution. https://start.camunda.com/ In above link, Click on Generate project and the zip file for simple Spring boot application will be downloaded. This can be imported into any IDE (ex. Eclipse, IntelliJ).

In src/main/resources path, there will be sample process.bpmn
file. All the bpmn files we create must be placed in this path.

Now that our environment setup is ready, Let’s learn how to draw BPMN.

Some basic notations

Using Camunda modeler, we can draw BPMN and deploy the same in Camunda engine.

  • Start event:
    This is used to specify the start of the process. Any pre
    activities can be done here.
    Image description

  • Script task:
    This is used for writing any business logic or checks in the
    BPMN internally.
    For ex. Basic condition check or validations. Script
    format can be Groovy, JavaScript, or Python.
    Image description

  • Service task:
    This is used when we want to define the logic externally and
    make a call from BPMN to plug in the logic. It provides
    different implementation options like Java Class,
    Expression, Connector etc. Using connector, we can integrate
    rest calls to external or internal APIs.

Image description

  • Sequence flow: This is used to denote the sequence in which process must proceed.

Image description

  • Exclusive gateway: As name suggests, this is used for deciding the sequence based on the certain condition.

Image description

  • End event: This is used to specify the end of the process.

Image description

Using all the notations we learned above, lets draw a BPMN for below use case.

Use case

Booking flight ticket for given source and destination.

Below could be the BPMN process for achieving the use case.

Image description

Here, T1 is the task to check the ticket availability and we have Exclusive gateway to determine the flow based on the result of T1. If ticket is available, we proceed to T2 or else we proceed with T5.
After T2, again there is the Exclusive gateway which will decide the sequence based on results of T2. If Book ticket task is success, proceed to T3 or else T4.

Arrows in between the tasks denotes the sequence. Note that, these arrows can be drawn in reverse as well. Wherever the arrow points will decide the flow. So, to proceed from T1 to T2, arrow must be drawn from T1 to T2 not vice versa.

By deploying above BPMN with all logics and API integration in the Camunda engine, we can test all possible scenarios. Debugging can be done easily via the GUI provided by Camunda engine. Camunda GUI offers Cockpit which can be used to debug the process if it gets failed.

This is very simple use case with basic notations used.
Camunda BPM provides much more notations to serve complex use cases.

Hope you understood some basics of Camunda and BPMN in this article. Let’s see how to create Rest API and integrate it with our BPMN and deploy to our Engine in the next article.

Few buzz words

Process: In BPM engine, every workflow is called as a process and instance of the process is called process Instance. (As in Class and Object).
Task: Task is the activity we perform inside the process.
Sequence flow: The arrows which determines the path.
Event: Represented in circles, describes something that happens during process execution. (for ex. start event, end event, error event etc.,.)
Gateway: This is used to decide the path based on data or condition.

Happy Learning! 😊

Top comments (0)