# Addressing Business Process Deviations through the Evaluation of Alternative Pattern-Based Models
## 3 Materials and Methods
### Output State Token Estimation  
The output state token represents the set of valid state tokens when exiting task \(A\). This information can be derived by applying transformations to the input state token \(ST=<K,P,R,V>\) as described by \(O_{A}\) (cf. Section Task Characterization in Section 3.1.2) on KPIs, resources, products and variables. Instead of explicitly computing the complete set of valid state tokens, for computational issues, only a simpler superset of the valid state token is computed called an estimated state token (\(\widetilde{ST}_{A}\)). This estimated state token (\(\widetilde{ST}_{A}\)) is a set of state tokens containing, at minimum, all the valid states resulting from the actual transformation caused by task \(A\). By extension, if the task's input consists of an estimated state token \(\widetilde{ST}_{A}\) instead of a single state token (\(ST_{A}\)) the estimated output state token \(\widetilde{ST}_{\overline{A}}\) is obtained by computing a superset of the union of all estimated output state tokens for each state token in \(\widetilde{ST}_{A}\).  
As previously mentioned, the estimated state token is a set of potential state tokens. However, when the model is executed only one of the state tokens within this set will be realized. For example, in the case where the duration of a task falls within the range of [10 min, 20 min], it becomes impossible to ascertain the precise duration of this task during the estimation of the exit state token. Therefore, all possible values within the duration range must be taken into account in the estimated state token.  
The following describes how the state token is estimated when tasks are connected to each other in a BPMN model. This paper focus on three main configurations: sequential execution (in series), parallel execution (AND) and exclusive execution (XOR).  
* Sequential execution Considering a sequential configuration, as shown in Figure 2, \(\widetilde{ST}_{\overline{A}}\) is estimated and becomes \(\widetilde{ST}_{\overline{B}}\). Then, as describe above, \(\widetilde{ST}_{\overline{B}}\) can be estimated (cd Section Output State Token Estimation of Section 3.1.2). This can be easily generalized to a sequence of \(n\) tasks.
* In the parallel execution configuration, as illustrated in Figure 3, all paths are considered. Subsequently, each input state token is divided into several parts (one for each branch) such that the recombination of all parts reconstitutes the original input state token. Next, the estimated output state token for each branch is computed, and their recombination yields the corresponding estimated output state token for the parallel execution of \(W_{1},\ldots,W_{n}\). Furthermore, the estimated state token for the entire parallel execution is obtained by computing a simple superset of the union of all the estimated  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Task Characterization-** & **Annotation** & **Task Entry** &
\begin{tabular}{c} **During** \\ **Execution** \\ \end{tabular} & **Task Exit** \\ \hline Resources & \(R_{A}\) & True & True &... \\ Constraints & \(C_{A}\) & True & True & True \\ Input & \(I_{A}\) & True &... &... \\ Output & \(O_{A}\) &... &... & True \\ \hline \hline \end{tabular}
\end{table}
Table 2: Task element characterization.  
Figure 2: Sequential execution of tasks.  
state tokens. Instead of individually evaluating the transformation of each input state token, an estimation is made for the set of state tokens associated with each part (input of the branches). Nevertheless, this does not change the rest of the process.  
* Exclusive execution
* In the case of exclusive execution, as shown in Figure 4, each branch is executed with the subset of the input state tokens that fit the entry condition of the branch. At the end, a simple superset of the union of all the estimated output tokens obtained from each branches is computed.