📜 ⬆️ ⬇️

Using binary relations over sets to solve a practical problem

When developing a computerized business process management system, we faced the problem of assigning specific performers to the roles.
There are two traditional approaches to the implementation of this designation:
Both of these approaches have significant disadvantages.
It turned out that the use of binary relations over sets in this case allows us to develop a very simple but very effective solution to the problem of building a role initializer.

A binary relation for finite sets A and B can be defined by defining a set of ordered pairs in which the first element belongs to the set A and the second to the set B. The following shows how this simple concept helps to solve the task of initializing the role of the business process.
Process management automation systems distribute tasks to executives in accordance with business process diagrams, as well as monitor their implementation
Roles in a business process are used to associate the nodes of a business process with task performers. When developing a business process, a role is created and assigned to certain nodes of the business process diagram. Role initialization is an assignment to the role of a specific performer.
In a business process, as a rule, at the time of its launch, the meanings of certain roles are already known. For example, it is known which user started the business process. In most cases, it is required to find values ​​for other roles by known values ​​of roles. If an employee of an enterprise has launched a business process for filing an application for a resource, then the manager of the employee must confirm or deny this application. That is, to initialize new roles, based on the values ​​of already initialized roles, it is necessary to somehow define the connections between employees of the enterprise.
Thinking about this problem, I remembered that at Moscow State University, in my second year, I was studying binary relations over sets. If we consider the employees of an enterprise as elements of a set, then with the help of this construction, it is just possible to set up ordered relations between employees.
Then the initialization of the role can be done as follows:
1. We assign binary relations for a set of enterprise employees, which are sets of ordered pairs of employees.
2. For the roles of business processes initialized with the help of binary relations, we indicate the role already known by the time of initialization.
3. In the procedure for assigning a performer to the role, we take the executing value of the already known role associated with the initializer. This value will correspond to the right side of the binary relation. We build the set of values ​​of all the left elements of relationship pairs, in which the right element coincides with the performer of the already known role.
4. This set and initialize the role. The fact that in this case a role can have more than one possible performer is not terrible: the corresponding task will be sent to all possible performers, but only one performer will perform it, the one who will take the task first.
However, it is not always convenient to specify binary relations by listing all pairs of performers that define it, since there can be a lot of such pairs. Therefore, we expand the set on which binary relations are defined. Let us allow the use of groups of performers in pairs other than performers.
Then, by the already known role, we will select pairs, on the right side of which there is either a performer - the meaning of this role, or a group containing this performer. Thus, it is possible to significantly reduce the number of relation-setting pairs.
Implementation of the role initialization algorithm

The algorithm was implemented in practice, - in the free open source system RunaWFE. Another item was added to the main menu of the system - Relations:
image
At this point, you can view / add / delete a relation, open a relation and edit a set of its component pairs:
image
Initializing a role using a binary relation in a business process editor

In the editor, in the business process, when editing the role initializer, you can select the “set role using relationship” tab. In this case, you can set the server connection settings and import the relationship into the editor:
image
Further, the relationship can be assigned to the role. The form selects the name of the relationship and a variable or constant corresponding to the right side of the relationship, specifying the user or group of users:
image

')

Source: https://habr.com/ru/post/200596/


All Articles