# Towards a Domain-Specific Modeling Language for Extracting Event Logs from ERP Systems
## 3 Motivation and Running Example  
An ERP system is a business suite of integrated applications that supports the major business processes of an organization. Typical examples of such processes in ERP systems are purchase order fulfillment and manufacturing. The key characteristic of an ERP system is that the different types of documents are used to record transaction data that are often tied to the execution of process activities. For instance, material documents record goods that are either received into or issued from inventory. Document types are implemented as table pairs with parent-child relationships between tables. This can be represented as a header and lines pattern, where the header table holds general information of a document and the lines table captures specific line item information of a document. The header and lines design pattern is very common for business applications that deal with documents, such as ERP, customer relationship management (CRM), and supply chain management (SCM) systems. In ERP systems, the process logic and business rules are both embedded in the application code managing documents in typically many-to-many relationships [13; 26]. The presence of these complex data dependencies has a large influence on the definition of cases for process mining analysis. When a process has one-to-many and many-to-many relations between documents, the user has to choose one document as a case notion as multiple documents can be linked to a single process execution. Experience teaches us that the ability to obtain the event log, which accurately represents reality, depends on this decision. Here, we introduce an ordering process as a running example to illustrate the complex data dependencies in an ERP system. In general, the process involves supplying goods or services, receiving supplies, and processing invoices. The process starts with creating a purchase order which is forwarded to the selected vendor. When the vendor delivers supplies, a purchase receipt document is created and an invoice for the payment is registered. Figure 1 gives a simplified example data set from the ordering process supported by the Microsoft Dynamics NAV ERP system. This example of transactional data describes the event type of creating a document. Note that multiple invoices can be received for a single order (IN1 and IN2 refer to PO1) and one invoice can be matched to multiple purchase orders (IN1 refers to PO1 and PO2). As already mentioned, a process instance represents the unique document or case object that is followed throughout the process. An invoice, a receipt, or purchase order can be selected as a process instance, i.e., case notion. If a purchase order is selected as the process instance, the trace of process instance PO1 reveals the link from the book invoice to the posting goods receipt activity in the discovered process model shown in Figure 2. There are two posting goods receipt events (R1 and R3) and two book invoice events (IN1 and IN2) for the process instance (PO1). Due to the multiple instances of the same activity referring to the single process instance, the link may indicate the false dependency between the events. For instance, we can infer that there are invoices registered before the related purchase order is received; however, receipt document R3 is created before invoice document IN2, but this is not visible in the discovered process model. This situation corresponds to the data divergence problem. The data convergence problem is a result of a many-to-one relationship between the document that represents a process instance and its related document, and the problem is related to the number of times an activity is performed. For instance, invoice IN1 is matched to two different purchase orders (PO1 and PO2). Within the ERP system, invoice IN1 is registered only once but is extracted twice and the event is duplicated in the process model discovered using traditional process mining techniques.