Skip to content

require-gio/pm4py-resetnet

 
 

Repository files navigation

PM4Py Resetnet

PM4Py Resetnet is a fork based on the PM4PY library. It has the goal to provide a mapping from BPMN to reset nets which require less modeling overhead than Petri nets. The speciality of the approach lies in the support for BPMN models with cancellation features. Thus, a user can import a BPMN model, translate it to a language-equivalent reset net and apply further analysis on it.

Example

A very simple example how a model with cancellation features is mapped:

import os
from pm4py.objects.bpmn.importer import importer as bpmn_importer
from pm4py.objects.conversion.bpmn import converter as reset_net_converter
from pm4py.visualization.petri_net import visualizer as pn_visualizer

bpmn_graph = bpmn_importer.apply(os.path.join("tests","input_data","cancellation.bpmn"))
parameters = {}
# should the amount of reset arcs be minimized wherever possible?
parameters["optimize"] = False
# should the resulting model be reduced by silent transitions?
parameters["reduced"] = True
# should boundary events be treated as labelled activities?
parameters['include_events'] = True
reset_net, initial_marking, final_marking = reset_net_converter.apply(bpmn_graph, 
variant=reset_net_converter.RESET_VARIANT, parameters=parameters)
# viualize resulting model
gviz = pn_visualizer.apply(reset_net, initial_marking, final_marking)
pn_visualizer.view(gviz)

# for comparison, also visualize the language-equialent petri net
bpmn_graph = bpmn_importer.apply(os.path.join("tests","input_data","cancellation_dijkman.bpmn"))
petri_net, initial_marking, final_marking = reset_net_converter.apply(bpmn_graph, variant=reset_net_converter.DEFAULT_VARIANT, parameters=parameters)
gviz = pn_visualizer.apply(petri_net, initial_marking, final_marking)
pn_visualizer.view(gviz)

Input BPMN model:
drawing

Output reset net:
drawing

Supported Features

  • XOR-,AND-,OR-gateways (block-structured)
  • One start event per (sub)process
  • One normal end event per (sub)process
  • Internal cancellation, e.g., error end event inside subprocess + corresponding boundary event attached to subprocess
  • External cancellation, e.g., intermediate message event attached to subprocess (without corresponding end event inside subprocess)
  • Terminate end events

The mapping requires that the input BPMN models fulfil certain structural requirements. In general, only semi-block-structured models are supported. For other model types, a proper mapping cannot be guaranteed. Also, note that message flows are not supported. The definition for semi-block-structuredness can be given by fulfilling the following rules:
drawing

Difference to PM4PY original work

The following files differ from the original library:

  • #f5dd42 pm4py/objects/bpmn/importer/variants/lxml.py
  • #f5dd42 pm4py/objects/bpmn/exporter/variants/etree.py
  • #f5dd42 pm4py/objects/bpmn/obj.py
  • #f5dd42 pm4py/objects/bpmn/util/__init__.py
  • #f5dd42 pm4py/objects/petri_net/utils/petri_utils.py
  • #f5dd42 pm4py/objects/petri_net/utils/reduction.py
  • #f5dd42 pm4py/objects/conversion/bpmn/variants/__init__.py
  • #f5dd42 pm4py/objects/conversion/bpmn/converter.py
  • #42f551 pm4py/objects/conversion/bpmn/variants/to_reset_net.py
  • #42f551 pm4py/objects/conversion/bpmn/util/bpmn_utils.py
  • #42f551 pm4py/objects/conversion/bpmn/util/block_structure.py
  • #42f551 bpmn_mapping_example.py

#f5dd42 indicates changes to existing file #42f551 indicates new file

About

Extension of the PM4Py project with additional features concerning BPMN and reset nets.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 89.6%
  • Jupyter Notebook 10.4%