BPMN Support

PM4Py provides support for importing, exporting, and laying out BPMN diagrams. The supported BPMN elements are limited to the following:

  • Events (start/end events)
  • Tasks
  • Gateways (exclusive, parallel, inclusive)

Additionally, we offer functionality for converting between BPMN models and other process models implemented in PM4Py, such as Petri nets and BPMN diagrams.

BPMN 2.0 - Importing

BPMN 2.0 XML files can be imported using the following instructions:

                                
            
Visualization of the object referenced in the example.

BPMN 2.0 - Exporting

BPMN models can be exported using the following instructions. In this case, bpmn_graph is the Python object containing the model.

                                
            

BPMN 2.0 - Layouting

Layouting aims to arrange the nodes and edges of the BPMN diagram in an aesthetically pleasing manner. For this purpose, we use an octilinear edges layout. The following commands are used to perform the layouting:

                                
            

BPMN 2.0 - Conversion to Petri Net

Converting a BPMN model to a Petri net model allows the use of various PM4Py algorithms, such as conformance checking and simulation. This is a key operation in process mining. To convert a BPMN model into an (accepting) Petri net, you can use the following code:

                                
            
Visualization of the object referenced in the example.

BPMN 2.0 - Conversion from a Process Tree

Process trees are an important class of block-structured process models, often generated by the inductive miner algorithm. These models can easily be converted to BPMN models. Here's an example: First, we import an XES event log and discover a process model using the inductive miner:

                                
            
Visualization of the object referenced in the example.

Next, we can convert the discovered model into a BPMN graph:

                                
            
Visualization of the object referenced in the example.