# Business Process Configuration according to Data Dependency Specification
## 4 Conf-BP Framework: A Configurable System to Create Imperative BP
### Automatic Transformation from Declarative to Imperative Model  
The transformation from the declarative description into an imperative model is a difficult and hard task, since it implies the analysis of every possible configuration to obtain at design time the most optimal model at runtime. The difficulty lies in establishing the order of the activities and the control flow components that combine the activities, taking into account the data dependencies. To perform the optimal transformation, we propose the three steps shown in Figure 6.  
1. **Create a Constraint Optimization Problem using the declarative Model**: As explained in detail in Section 4.3.1, we used Constraint Satisfaction Problems (CSPs) [48] to solve the configuration problem. CSPs represent a reasoning methodology consisting of the representation of a problem by means of a set of variables, domains and constraints. CSPs have also a declarative description, then very similar to the Declarative Specification of ConfD-BP. CSPs are a widely used model-based knowledge representation formalism. In a formal way, it is defined as a tuple \(\langle X,\,D,\,C\rangle\), where \(X=\{x_{1},\,x_{2},\,\ldots,\,x_{n}\}\) is a finite set of variables, \(D=\{d(x_{1}),\,d(x_{2}),\,\ldots,\,d(x_{n})\}\) is a set of domains of the values of the variables, and \(C=\{C_{1},\,C_{2},\,\ldots,\,C_{m}\}\) is a set of constraints. A constraint \(C_{i}=(V_{i},R_{i})\) specifies the possible values of the variables in \(V\) that simultaneously satisfy \(R\). Let \(V_{k}=\{x_{k_{1}},\,x_{k_{2}},\,\ldots,\,x_{k_{k}}\}\) be a subset of \(X\), and an l-tuple \((x_{k_{1}},\,x_{k_{2}},\,\ldots,\,x_{k_{l}})\) from \(d(x_{k_{1}})\), \(d(x_{k_{2}}),\,\ldots,\,d(x_{k_{l}})\) can therefore be called an _instantiation_ of the variables in \(V_{k}\). An instantiation is a solution if and only if it satisfies the constraints \(C\). If an objective function is included in the CSP, it is called a Constraint Optimization Problem (COP). It is necessary to highlight that CSP and COP specifications are very similar to the process models proposed here, since both are declarative models which define the problem but do not solve it. A solver of CSPs or COPs tries to find a possible tuple of values for the variables that satisfy the constraints defined in the domain. 2. **Solve the COP**: To solve the COP created in the second step, it is necessary to analyze the possible values of the variables to find the satisfied tuples. To avoid the analysis of every possibilities of values of variables, the solvers use a combination of search and consistency techniques [49] reducing drastically the complexity and time consuming. The consistency techniques remove inconsistent values from the domains of the variables during or before the search. Several local consistency and optimization techniques have been proposed as ways of improving the efficiency of search algorithms. There are several commercial constraint problem solvers. The main  
Figure 6: Configuration problem Transformation. difference between them is the programming language that they use, and the types of constraints that can be included. For the proof of concept to validate the configuration problem, we have used JosloverTM [50], although any of the existing CSP solvers could be used, since the constraints that we need to include (explained in Section 4.3.1) are very common and supported by every commercial solvers. The resolution of the COP will obtain a set of time intervals, each of them associated with an activity, representing the moment when each activity can start and end. 3. **Translate the COP solution into a BPMN Model**: As explained in detail in Section 4.3.2, by using the results obtained from the COP, the imperative model can be created. This result has to be interpreted as gateways that relate the activities. For example, if the COP allows that two activities A and B could start at the same instant of time, perhaps there is a constraint which states that only one activity can be executed in each instance.