pm4py.convert.convert_to_process_tree#
- pm4py.convert.convert_to_process_tree(*args: Tuple[PetriNet, Marking, Marking] | BPMN | ProcessTree) ProcessTree [source]#
Converts an input model to a process tree.
The input models can be Petri nets (with markings) or BPMN models. For both input types, the conversion is not guaranteed to work and may raise an exception.
- Return type:
- Parameters:
args –
If converting from a Petri net: a tuple of (
PetriNet
,Marking
,Marking
).If converting from a BPMN or ProcessTree: a single object of the respective type.
- Returns:
A
ProcessTree
object.
import pm4py # Imports a BPMN file bpmn_graph = pm4py.read_bpmn("tests/input_data/running-example.bpmn") # Converts the BPMN to a process tree (through intermediate conversion to a Petri net) process_tree = pm4py.convert_to_process_tree(bpmn_graph)