pm4py.convert.convert_to_bpmn#

pm4py.convert.convert_to_bpmn(*args: Tuple[PetriNet, Marking, Marking] | ProcessTree) BPMN[source]#

Converts an object to a BPMN diagram.

As input, either a Petri net (with corresponding initial and final markings) or a process tree can be provided. A process tree can always be converted into a BPMN model, ensuring the quality of the resulting object. For Petri nets, the quality of the conversion largely depends on the net provided (e.g., sound WF-nets are likely to produce reasonable BPMN models).

Return type:

BPMN

Parameters:

args

  • If converting a Petri net: a tuple of (PetriNet, Marking, Marking).

  • If converting a process tree: a single ProcessTree object.

Returns:

A BPMN object.

import pm4py

# Import a Petri net from a file
net, im, fm = pm4py.read_pnml("tests/input_data/running-example.pnml")
bpmn_graph = pm4py.convert_to_bpmn(net, im, fm)