BPMN process CSV export

Implementation of exporting process to CSV functionality, as proposed in article “Spreadsheet-Based Business Process Modeling” by Kluza k. and Wisniewski P.

class bpmn_python.bpmn_process_csv_export.BpmnDiagramGraphCsvExport

Class that provides implementation of exporting process to CSV functionality

staticmethod export_element(bpmn_graph, export_elements, node, nodes_classification, order=0, prefix='', condition='', who='', add_join=False)

Export a node with “Element” classification (task, subprocess or gateway)

Parameters:
  • bpmn_graph – an instance of BpmnDiagramGraph class,
  • export_elements – a dictionary object. The key is a node ID, value is a dictionary of parameters that will be used in exported CSV document,
  • node – networkx.Node object,
  • nodes_classification – dictionary of classification labels. Key - node id. Value - a list of labels,
  • order – the order param of exported node,
  • prefix – the prefix of exported node - if the task appears after some gateway, the prefix will identify the branch
  • condition – the condition param of exported node,
  • who – the condition param of exported node,
  • add_join – boolean flag. Used to indicate if “Join” element should be added to CSV.
Returns:

None or the next node object if the exported node was a gateway join.

staticmethod export_end_event(export_elements, node, order=0, prefix='', condition='', who='')

End event export

Parameters:
  • export_elements – a dictionary object. The key is a node ID, value is a dictionary of parameters that will be used in exported CSV document,
  • node – networkx.Node object,
  • order – the order param of exported node,
  • prefix – the prefix of exported node - if the task appears after some gateway, the prefix will identify the branch
  • condition – the condition param of exported node,
  • who – the condition param of exported node,
Returns:

None or the next node object if the exported node was a gateway join.

staticmethod export_node(bpmn_graph, export_elements, node, nodes_classification, order=0, prefix='', condition='', who='', add_join=False)

General method for node exporting

Parameters:
  • bpmn_graph – an instance of BpmnDiagramGraph class,
  • export_elements – a dictionary object. The key is a node ID, value is a dictionary of parameters that will be used in exported CSV document,
  • node – networkx.Node object,
  • nodes_classification – dictionary of classification labels. Key - node id. Value - a list of labels,
  • order – the order param of exported node,
  • prefix – the prefix of exported node - if the task appears after some gateway, the prefix will identify the branch
  • condition – the condition param of exported node,
  • who – the condition param of exported node,
  • add_join – boolean flag. Used to indicate if “Join” element should be added to CSV.
Returns:

None or the next node object if the exported node was a gateway join.

staticmethod export_process_to_csv(bpmn_diagram, directory, filename)

Root method of CSV export functionality.

Parameters:
  • bpmn_diagram – an instance of BpmnDiagramGraph class,
  • directory – a string object, which is a path of output directory,
  • filename – a string object, which is a name of output file.
staticmethod export_start_event(bpmn_graph, export_elements, node, nodes_classification, order=0, prefix='', condition='', who='')

Start event export

Parameters:
  • bpmn_graph – an instance of BpmnDiagramGraph class,
  • export_elements – a dictionary object. The key is a node ID, value is a dictionary of parameters that will be used in exported CSV document,
  • node – networkx.Node object,
  • order – the order param of exported node,
  • nodes_classification – dictionary of classification labels. Key - node id. Value - a list of labels,
  • prefix – the prefix of exported node - if the task appears after some gateway, the prefix will identify the branch
  • condition – the condition param of exported node,
  • who – the condition param of exported node,
Returns:

None or the next node object if the exported node was a gateway join.

staticmethod write_export_node_to_file(file_object, export_elements)

Exporting process to CSV file

Parameters:
  • file_object – object of File class,
  • export_elements – a dictionary object. The key is a node ID, value is a dictionary of parameters that will be used in exported CSV document.