Process Diagram Visualization

A BPMN process diagram is a formidable place to visualize information around your process. We recommend using JavaScript libraries to display process diagrams and enrich them with additional information.

In our web applications Cockpit and Tasklist, we use bpmn.io, a toolkit for rendering BPMN 2.0 process models directly in the browser. It allows to add additional information to the diagram and includes ways for user interaction. Although bpmn.io is still under development, its API is rather stable.

The previous Javascript BPMN renderer can still be found at camunda-bpmn.js, but it is not actively developed anymore.

bpmn.io Diagram Renderer

In order to render a process diagram, you need to retrieve the diagram XML via the Java- or REST API. The following example shows how to render the process xml using bpmn.io. For more documentation regarding the annotation of the diagram and user interaction, please refer to the bpmn.io page.

var BpmnViewer = require('bpmn-js');

var xml = getBpmnXml(); // get the process xml via REST
var viewer = new BpmnViewer({ container: 'body' });

viewer.importXML(xml, function(err) {

  if (err) {
    console.log('error rendering', err);
  } else {
    console.log('rendered');
  }
});

Alternatively, you can use the bpmn-viewer widget from the Camunda commons UI.

On this Page: