pm4py.objects.dcr.distributed package#

Submodules#

pm4py.objects.dcr.distributed.obj module#

class pm4py.objects.dcr.distributed.obj.DistributedDcrGraph(template=None)[source]#

Bases: DcrGraph

A class representing a Role-based DCR graph.

This class wraps around a DCR graph structure, extending it with role-based features such as principals, distributed, role assignments, and principals assignments. It provides an interface to integrate distributed into the DCR model and to compute role-based constraints as part of the graph. Attributes derived according to dcr graphs with distributed in [1].

gDCRGraph

The underlying DCR graph structure.

templatedict, optional

A template dictionary to initialize the distributed and assignments from, if provided.

self.__gDCRGraph

The underlying DCR graph structure.

self.__principalsSet[str]

A set of principal identifiers within the graph.

self.__rolesSet[str]

A set of role identifiers within the graph.

self.__roleAssignmentsDict[str, Set[str]]

A dictionary where keys are activity identifiers and values are sets of distributed assigned to those activities.

self.__principalsAssignmentDict[str, Set[str]]

A dictionary where keys are activity identifiers and values are sets of principals assigned to those activities.

getConstraints() -> int:

Computes the total number of constraints in the DCR graph, including those derived from role assignments.

dcr_graph = DCRGraph(…)

role_graph = RoleDCR_Graph(dcr_graph, template={

“principals”: {“principal1”, “principal2”},

“roles”: {“role1”, “role2”},

“roleAssignments”: {“activity1”: {“role1”}},

“principalsAssignments”: {“activity1”: {“principal1”}}

})

Access role-based attributes

principals = role_graph.principals

roles = role_graph.distributed

role_assignments = role_graph.roleAssignments

principals_assignment = role_graph.principalsAssignment

Compute the number of constraints

total_constraints = role_graph.getConstraints()

obj_to_template()[source]#
property principals: Set[str]#
property roles#
property role_assignments#
property principals_assignments#
get_constraints()[source]#

compute role assignments as constraints in DCR Graph and the constraints in the underlying graph

Returns#

int

number of constraints in dcr graph

pm4py.objects.dcr.distributed.semantics module#

Module contents#