BPMN diagram metrics

Package provides set of functions for calculating complexity metrics of BPMN 2.0 XML models represented by objects of BpmnDiagramGraph class.

bpmn_python.bpmn_diagram_metrics.AverageGatewayDegree_metric(bpmn_graph)

Returns the value of the Average Gateway Degree metric (“Average of the number of both incoming and outgoing arcs of the gateway nodes in the process model”) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.CoefficientOfNetworkComplexity_metric(bpmn_graph)

Returns the value of the Coefficient of Network Complexity metric (“Ratio of the total number of arcs in a process model to its total number of nodes.”) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.DurfeeSquare_metric(bpmn_graph)
Returns the value of the Durfee Square metric
(“Durfee Square equals d if there are d types of elements which occur at least d times in the model (each), and the other types of elements occur no more than d times (each)”) for the BPMNDiagramGraph instance.
Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.GatewayHeterogenity_metric(bpmn_graph)

Returns the value of the Gateway Heterogenity metric (“Number of different types of gateways used in a mode”) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.NOAC_metric(bpmn_graph)

Returns the value of the NOAC metric (Number of Activities and control flow elements) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.NOAJS_metric(bpmn_graph)

Returns the value of the NOAJS metric (Number of Activities, joins and splits) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.NOA_metric(bpmn_graph)

Returns the value of the NOA metric (Number of Activities) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.NumberOfNodes_metric(bpmn_graph)

Returns the value of the Number of Nodes metric (“Number of activities and routing elements in a model”) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.PerfectSquare_metric(bpmn_graph)

Returns the value of the Perfect Square metric (“Given a set of element types ranked in decreasing order of the number of their instances, the PSM is the (unique) largest number such that the top p types occur(together) at least p2 times.”) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.TNEE_metric(bpmn_graph)

Returns the value of the TNEE metric (Total Number of End Events of the Model) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.TNE_metric(bpmn_graph)

Returns the value of the TNE metric (Total Number of Events of the Model) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.TNIE_metric(bpmn_graph)

Returns the value of the TNIE metric (Total Number of Intermediate Events of the Model) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.TNSE_metric(bpmn_graph)

Returns the value of the TNSE metric (Total Number of Start Events of the Model) for the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
bpmn_python.bpmn_diagram_metrics.all_activities_count(bpmn_graph)

Returns the total count of all activities in the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:total count of the activities in the BPMNDiagramGraph instance
bpmn_python.bpmn_diagram_metrics.all_control_flow_elements_count(bpmn_graph)

Returns the total count of all control flow elements in the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:total count of the control flow elements in the BPMNDiagramGraph instance
bpmn_python.bpmn_diagram_metrics.all_events_count(bpmn_graph)

Returns the total count of all events elements in the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:total count of the events elements elements in the BPMNDiagramGraph instance
bpmn_python.bpmn_diagram_metrics.all_gateways_count(bpmn_graph)

Returns the total count of all gateway elements in the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:total count of the gateway elements in the BPMNDiagramGraph instance
bpmn_python.bpmn_diagram_metrics.get_activities_counts(bpmn_graph)

Returns the count of the different types of activities in the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:count of the different types of activities in the BPMNDiagramGraph instance
bpmn_python.bpmn_diagram_metrics.get_all_gateways(bpmn_graph)

Returns a list with all gateways in diagram

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:a list with all gateways in diagram
bpmn_python.bpmn_diagram_metrics.get_events_counts(bpmn_graph)

Returns the count of the different types of event elements in the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:count of the different types of event elements in the BPMNDiagramGraph instance
bpmn_python.bpmn_diagram_metrics.get_gateway_counts(bpmn_graph)

Returns the count of the different types of gateways in the BPMNDiagramGraph instance.

Parameters:bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
Returns:count of the different types of gateways in the BPMNDiagramGraph instance
bpmn_python.bpmn_diagram_metrics.get_nodes_count(bpmn_graph, node_type=None)

Gets the count of nodes of the requested type. If no type is provided, the count of all nodes in BPMN diagram graph is returned.

Parameters:
  • bpmn_graph – an instance of BpmnDiagramGraph representing BPMN model.
  • node_type – string with valid BPMN XML tag name (e.g. ‘task’, ‘sequenceFlow’).