# Spreadsheets as Interoperability Solution for Business Process Representation
## 5 Mapping a Spreadsheet with a BPMN Model
### Transformation Procedure  
As it has been already mentioned before, the purpose of providing a spreadsheet-based representation of business processes is to facilitate process modeling for people who are unfamiliar with existing languages and notations. Therefore, an automated transformation of the exported spreadsheet into a BPMN diagram is a significant feature. The proposed algorithm uses a CSV file as input and generates a business process graph, which can be then mapped with a BPMN 2.0 XML file. The tabular representation of the business process is imported as an array of structures, where each row is a collection of elements which correspond to column names. An example transformation algorithm, which does not include model validation, is presented in Algorithm 1. In order to simplify the structure of the represented algorithm (see Algorithm 1), several sub-procedures were used. Their meaning and usage is explained in the following points:  
1. \(getPhase(order)\)--Retrieve the phase based on the current activity order without considering the current branch. The result of this function is a vector of natural numbers, the length of which corresponds to the branching depth. For example, in case of nested gateways as shown in Table 12, the phase vector for Task 1 will be equal to \([1\ \ 0\ \ 0]\), while for Task 4 it will be \([2\ \ 1\ \ 1]\). 2. \(Graph.addVertex(uid,phase,name,type)\)--Insert an isolated vertex into the process graph, identifiable by its alphanumeric Order. 3. \(Graph.connect(vertex_{1},vertex_{2},wv)\)--Create a directed edge between \(vertex_{1}\) and \(vertex_{2}\) with weight vector \(wv\). 4. \(precedence(vertex_{1},vertex_{2})\)--Determine the precedence relation between two activities. This function returns a Boolean value which is true if the difference of the corresponding phase vectors is negative. 5. \(Graph.filterEdges(edgeSet)\)--Select the set of edges with the lowest non-zero weight vectors and keep them in the graph. Remove from \(G_{P}\) all the remaining edges, unless the removal isolates one of the graph vertices. 6. \(Graph.createSplitGatewayStructure/createMergeGatewayStructure(vertex)\)--Identify parallel relations by grouping neighbour vertices in the same phase. If activities in a group have no or the \begin{table}
\begin{tabular}{|l|l|l|l|} \hline \multicolumn{4}{|l|}{**Spreadsheet Representation**} & \multicolumn{2}{l|}{**BPMN/UML AD Representation**} \\ \hline Order & Activity & (...) & Who & (...) \\ \hline... &... & & \\ \hline
2 & Task 1 & Department B & \\ \hline
3 & Task 2 & Department A & \\ \hline... &... & & \\ \hline \end{tabular}
\end{table} 
Table 14: Swimlanes example. \begin{table}
\begin{tabular}{|l|l|l|l|} \hline \multicolumn{4}{|l|}{**Spreadsheet Representation**} & \multicolumn{2}{l|}{**BPMN Representation**} \\ \hline Order & Activity & Input & Output & (...) \\ \hline... &... & & \\ \hline
2 & Task 1 & obj1 & \\ \hline
3 & Task 2 & & obj2 & \\ \hline... &... & & \\ \hline \end{tabular}
\end{table} 
Table 15: Data object example. same conditions, then connect them with a parallel gateway. If among the conditions there is a keyword \"else\" then use an exclusive gateway. Otherwise connect the group of vertices with an inclusive (OR) gateway.