# Semi-Automated Approach for Building Event Logs for Process Mining from Relational Database
## 2 Background  
### Preliminaries and Definitions  
An event log is a hierarchically structured file with historical information about the execution of a business process generated by a process-oriented information system. Cases organize attribute values within an event log. A case contains a group of events that belong to the same business process execution. An event is made up of properties or attributes. An event's typical attributes are the activity's name, timestamp, and resource. Depending on the granularity required in the event log and the type of process mining in which this event log will be used, other attributes can be included. In this direction, the sequence of events related to a case is known as a trace. In summary, the following should be considered when generating an event log:  
* A process consists of cases.
* A case consists of events such that each event is related to a case.
* The events within a case must be ordered.
* Events can have a set of attributes.  
The proposed approach is formalized by the following definitions, considering the elements that comprise the framework explained in Section 3.  
**Definition 1** (Event log): _An event log \(L\) is composed of a set of traces \(T\) (see Definition 3), where \(T\) is all the business process execution instances. Each trace \(T_{i}\) is formed of a finite set of events \(E\) (see Definition 2), which are the events executed in the business process._  
**Definition 2** (Event): _An event \(e\in E\) is a tuple \(\varepsilon=(c,e,et)\), where \(e\in E\) is a process event, \(c\in C\) is a case identifier that allows identifying the events executed within the case identifier \(c\). et is a set of attributes describing each event \(e\). The main attributes are activity identifier (\(a\in e\)), timestamp (time : \(stamp\in e\)t), activity name (concept : name \(\in e\)t), and resource that executed the activity (resource \(\in e\)t), among others._  
**Definition 3** (Trace): _A trace is a sequence \(T_{c}=<e_{1},e_{2},....,e_{|T_{c}|}>\in E\) of events belonging to the same case (process instance), identified with the same case identifier \(c\). The events \(<e_{1},e_{2},....,e_{|T_{c}|}>\in E\) are ordered by their timestamps (time : \(stamp\))._  
**Definition 4** (BPMN process model): _This statement is based on the definition proposed by [26]. A business process model and notation (BPMN) process model is a graphical component \(M=(i,o,T,G,E_{m})\), where \(i\) is the initial event, \(o\) is the final event, and \(T\) is a non-empty set of tasks. \(G+\cup Gx\cup G*\) is the union of the \(AND\) gateway set (\(G+\)), the XOR gateway set (\(Gx\)), and the OR gateway set (\(G*\)); and \(E_{m}\subseteq(T\cup G\cup i)x(T\cup G\cup o)\) is the set of edges. Given \(g\in G\), \(g\) is a division gateway if it has more than one output edge or a union gateway if it has more than one input edge._  
**Definition 5** (Directly-Follows Graph (DFG)): _It is a component \(\varrho=(N,Ed)\) where \(N\) is the nodes that represent the events in the event log; and the edges \(Ed\) represent the direct relationship between two nodes \((A,B)\), if at least one trace \(T\) in the event log \(L\), the source node \(A\) is followed by the destination node \(B\)\((A\to B)\)[26; 27]. These graphs allow you to add or display additional model information, for example, the frequency of a relationship between node \(A\) and node \(B\) within the event log and the time elapsed between the transition from one node to another._