# Addressing Business Process Deviations through the Evaluation of Alternative Pattern-Based Models
## 3 Materials and Methods
### Element Characterization and Notations
#### 3.1.2 Task/Activity  
Task Characterization  
The BPMN is a well-established standard in BP modelling, as evident in previous studies. Moreover, the BPMN standard offers an XML representation of each element in the model, enabling the enrichment of tasks or activities in a manner similar to the SADT annotation, a widely discussed modelling technique in the literature. By incorporating constraints (\(C_{A}\)), resources (\(R_{A}\)), inputs (\(I_{A}\)), and outputs (\(R_{A}\)) into each task or activity (\(A\)) in the BPMN, it is feasible to comprehensively define each element and monitor the model's performance. All these conditions (\(C_{A},R_{A},I_{A},O_{A}\)) can be expressed as Boolean expressions.  
* Constraints \(C_{A}\): The constraint defines a condition expressed by a Boolean expression \(C_{A}\) that must be true at entry, during, and at exit of task \(A\). The constraints mostly apply to elements \(K\) and \(V\) of the state token \(ST\). For example: \[(Cost<30K\epsilon)\wedge(T^{\circ}>20^{\circ})\] where \(Cost\) is a KPI belonging to \(K\) and \(T^{\circ}\) is a state variable belonging to \(V\).
* Resources \(R_{A}\): Resources can be either local or global, and specifying them for each task or activity helps manage them more efficiently. It is important to mention at this point that resources management is not the object of this study. However, it is crucial to ensure normal execution of the workflow. As reported in [55], resources can be sorted in various ways. In this study, the main focus would be the behaviour of a resource rather than its type, namely allocation, utilization, and consumption. One can determine the availability of a resource \(r\) belonging to type \(T\) by verifying if \(r\) is present in the set of resources of type \(T\) available for the process. \(R_{A}\) represents the availability of resources needed by \(A\) as a Boolean expression. \(R_{A}\) must be true to enter task \(A\). This expression mostly applies to element \(R\) and \(P\) of the state token \(ST\). This expresses which resources are allocated by task \(A\) and will consequently be no longer available for other tasks during the execution of task \(A\).
* Inputs \(I_{A}\): \(I_{A}\) stands for the state token's necessary condition which is true at task entry. These conditions are mainly applied to \(K\) and \(V\).
* Outputs \(O_{A}\): \(O_{A}\) stands for the state token's necessary condition which is true at task exit. These conditions are applied to \(K\), \(P\), \(V\) and \(R\). \(O_{A}\) represents the transformation applied to the state token prior to entry, resulting in the state token after exit. This expresses the changes in KPIs, such as duration and cost, as well as the impact on resources and the product resulting from the task. In fact, \(R_{A}\) indicates which resources are kept by \(A\) during its execution but does not provide information about which will be available again at the exit of task \(A\). The expression of the consumption of resources by task \(A\) is then expressed in \(O_{A}\).  
This manuscript describes the use of the aforementioned characterizations represented in Figure 1 to repair any potential deviations that may arise during model execution. However, these characterizations may also be utilized in future studies for the detection of deviations, as well as for model optimization and improvement.  
Figure 1: General model of a task.  
Table 2 summarizes the new elements added to enrich the BPMN task and activity characterization, including constraints, resources, input, and output, to enable monitoring and control of model performance. Incorporating these elements can enhance the BPMN's representation of real-world processes and provide a more comprehensive framework for process modelling and management. A detailed discussion of these elements will be presented in the following.