Blog Posts bpmn-1-x Process Management

Build your Business App with BPMN 2.0

Blog: Imixs Workflow Blog

In this short tutorial I will explain how to build a business application with the Business Process Modelling Notation – BPMN. This approach differs from the usual data-centric approach as we focus on process management instead of data processing.

Data Processing vs. Process Management

When we follow the classical approach building a Data-Centric Business Application, we usually first design a data schema. The data schema defines what kind of data can be managed. The application allows us to create new data sets, edit existing data and of course search for data.

In a Process-Centric Business Application we instead first try to answer the question how data should be processed to give each actor the best access to information to reach a specific business goal. And this kind of question becomes more and more important in our today’s rapidly evolving business landscape. BPMN offers the perfect approach to model a workflow with its business goals from the beginning to the end. BPMN models can be created with various tools like for example the Open Source BPMN designer Open-BPMN.

One advantage of BPMN is that it does not only give all stake holders a more clear understanding about the process, a BPMN 2.0 Model can also be executed by a suitable process engine. This “low-code” or “model-driven” approach leads to a much more flexible way to implement business applications. Of course, data still plays an important role and workflow engines allow us to manage business data in various ways. So let’s see how this works…

Start with a Business Process…

First of all we have to think about the business process behind our business app. We need to focus on questions like:

As mentioned before a business process defines the way to achieve a concrete business goal. In a BPMN model we can describe this way form its beginning to the end. See the following example of a ‘Proposal Creation Process‘:

The BPMN model defines a Start (green) and End (red) event to mark the begin and end of the process. An Activity or Task Element (blue boxes in this diagram) defines a single step in a business process. This can also be a milestone to be reached. An event (blue circle) defines the transition into a new task or status. An event can be triggered external (e.g. ‘Order received form customer’) or by an actor (e.g. ‘Proposal created and submit for review’).

Business Rules

In addition we can define business rules to implement additional business logic. For example we can define that a Review in this process is only needed for Proposals with a bid amount over 1.000,00 EUR. For this you can define an Exclusive Gateway with conditional flows:

In this example the transition (Sequence Flow) between ‘Gateway-1’ and the ‘Review Task’ contains a condition like:


A BPMN engine can evaluate these kind of conditions by different script languages based on the data provided in the workflow. The data can either be stored directly in the process instance, or defined as a reference to an external data source. There are a number of more elements defined in the BPMN 2.0 standard that allow the modeling even of much more complex business processes.

Run Your Business Process…

Now let’s see how we can start and control such a BPMN process in an application. There are various BPMN engines available and a lot of them are open source. See the list of awesome-workflow-engines maintained by @meirwah on Github.

In the following I use the Imixs-Workflow engine which supports BPMN 2.0 and provides a docker container to start out of the box without the need to write any code. With the Imixs-Microservice we can start the BPMN Workflow engine in a container. Just create a local docker-compose.yaml file with the following content:

    image: postgres:13.11
      POSTGRES_PASSWORD: adminadmin
      POSTGRES_DB: workflow-db  
    image: imixs/imixs-microservice:latest
      TZ: "CET" 
      LANG: "en_US.UTF-8"  
      POSTGRES_USER: "postgres"
      POSTGRES_PASSWORD: "adminadmin"
      POSTGRES_CONNECTION: "jdbc:postgresql://imixs-db/workflow-db"
      - "8080:8080"

…and start the service with:

$ docker compose up

The service comes with a short welcome page at: http://localhost:8080 and also provides a Rest interface at http://localhost:8080/api/openapi-ui/index.html. This web interface allows us to test various methods to create a workflow or to process existing ones.

Upload your Model

First we need to upload our model. For this we can use the curl command and post our BPMN file to the Rest Service endpoint:

$ curl --user admin:adminadmin --request POST 
-Tmy-model.bpmn http://localhost:8080/api/model/bpmn

You can download the model from Github or you create a new file my-model.bpmn with the following content:

          <![CDATA[subject ]]>
          <![CDATA[Order submitted by $Editor]]>
      <b>Submit</b> a new ticket
          <![CDATA[subject ]]>
          <![CDATA[subject ]]>
      Create a new ticket
          <![CDATA[ticket solved by namcurrentEditor]]>

We can also post the model via the Rest UI at the resource /api/model/bpmn/

The status of all available models can be verified at:


Note: I use the userid ‘admin’ with the password ‘adminadmin’ here. More users with different roles are defined by this service. Find the details here.

Create a Process Instance

Now as the service is up and running, we can create our first process instance. For this we just need to post a XML Document containing the model information and our business data. We can use the Rest API Endpoint to post a new process instance at

POST: /api/workflow/workitem

		My first propsal...

In this example I define the modelversion, the initial task and the event to be processed, as also some custom business data (subject and amount).

The workflow engine automatically executes the data according to our uploaded BPMN model. To verify the result we can check the tasklist with all process instances created by the user ‘admin’:


As you can see the workflow engine has processed our data and applies the status ‘Completed‘ to our new workflow instance. To test our business logic we can now change the amount to a value greater than 1.000,00 which will create another new process instance in the status ‘Review’ according to our business rule.

We can now easily change the process logic and add new tasks or business rules. All we have to do is to upload the new version of the BPMN model.

To update the data of an existing process instance we can now post the data together with the $uniqueid and the corresponding event from our model:

		Baker Street 221b.

The field $uniqueid is returned by the first creation of a new workflow instance and can be used as a reference for further processing steps. The Workflow engine will verify each event according to the assigend model. We can also use the uniqueID to fetch the data from the workflow engine, e.g. to display the data in a web interface.

How to Integrate BPMN into your App?

In this tutorial, I have deliberately omitted the design of a web interface because I wanted to focus on the business logic. When using a Rest API – as in this example – the workflow engine can be integrated into an application easily by using different frontend technologies. In addition, there are often other ways to connect a BPMN engine to your own application depending on the framework used by the engine. For example a lot of Open Source Engines are based on Java and can be integreated by common build tools like Maven or Gradle.

For example you can integrate the Imixs Workflow engine into a Jakarta EE app with the following dependencies:


… and call the engine within your code using the CDI Framework like this:

private org.imixs.workflow.engine.WorkflowService workflowService;

ItemCollection workitem=new ItemCollection().model("proposal-en-1.0").task(1000).event(10);
// assign some business data...
// process the workitem
workitem = workflowService.processWorkItem(workitem);

This code example is equal to the Rest API call in the example above.

Data Integration

Another aspect is the way you handle your business data. In my example code I embedded the business data directly into the workflow instance.

But of course in some szenarious it may be usefull to just store a reference to an external dataset

or reference the workflow instance inside your data processing application by extending the data schema.


In summary, incorporating BPMN 2.0 into your business application development offers a structured and efficient way to handle your business processes. The ability to visually model workflows not only simplifies the design and management of complex systems but also enhances collaboration across teams. By using tools like Imixs-Workflow, you can easily implement BPMN 2.0 standards, ensuring that your business applications are both scalable and adaptable. Embracing BPMN 2.0 can lead to more organized, transparent, and effective business operations, setting the stage for greater success and growth.

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples