PM4Py provides support for importing, exporting, and laying out BPMN diagrams. The supported BPMN elements are limited to the following:
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 XML files can be imported using the following instructions:
BPMN models can be exported using the following instructions. In this case, bpmn_graph
is the Python object containing the model.
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:
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:
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:
Next, we can convert the discovered model into a BPMN graph: