- pm4py.convert.convert_to_process_tree(*args: Union[Tuple[PetriNet, Marking, Marking], BPMN]) ProcessTree #
Converts an input model to a process tree. The input models can either be Petri nets (marked) or BPMN models. For both input types, the conversion is not guaranteed to work, hence, invocation of the method can yield an Exception.
args – petri net (along with initial and final marking) or BPMN
- Return type:
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)