# DataStream XES Extension: Embedding IoT Sensor Data into Extensible Event Stream Logs
## 2 Foundations and Related Work
### Process Mining
Holding the extracted, transformed and aggregated data (i.e., after process mining, or after process execution) in a flexible, structured long-term storage format is imperative. This section discusses how XES can be extended to better support this goal. XES is built around events. Each process activity execution can lead to a set of events in an XES log file, following the life-cycle (see Section 2) of the execution of that activity in a particular instance, i.e., each activity could lead to a _\"start\"_ event, to a _\"complete\"_ event, and to an arbitrary number of events in between, depending on the utilized life-cycle model. Many XES log files just store one event per executed activity, thus sensor readings could be attached to this event. Other available logs, such as [53], expose a custom fine-grained life-cycle model, that anchors sensor readings to an event with special XES lifecycle:transition. An execution of the model shown in Figure 2 leads to the XES log described in Listing 1. As mentioned in the XES Standard [7] (p. 5):

\"Log, trace, and event objects contain no information themselves. They only define the structure of the document. All information in an event log is stored in attributes. Attributes describe their parent element (log, trace, etc.). All attributes have a string-based key.\"

However, as we indicated before, XES cannot be directly used to store IoT-enhanced BP logs. Specifically, we distinguish three different cases (see Figure 3) where IoT data might be connected to process activities, according to which part of the process that data may be relevant for:

* **\"Single Activity\" Context**: A time-series of sensor readings from at least one sensor is connected to a single activity, e.g., when the activity represents the machining of a part, collected sensor data might describe various aspects, such as the throughput of coolant while machining, a discrete series of vibration readings, or a function (continuous data) describing the noise generation (volume). All sensor data can be assigned to a particular activity, being the data relevant between the start and the completion of the activity. * **\"Group of Activities\" Context**: A time-series of sensor readings from at least one sensor is connected to a set of activities. This is especially relevant for environmental sensors, which for example span a multitude of production steps. For instance, temperature changes during several process activities might give insights into certain quality properties of a finished product but cannot be clearly attributed to a single step (e.g., significance of the difference between temperatures measured at the start of activity 1, and at the end of activity n). * **\"Trace\" Context**: A time-series of sensor readings from at least one sensor is connected to a whole trace. This case is analogous to the \"Group of Activities\" case. This is for instance necessary when the sensor readings from a period before and/or after individual activities may be relevant for the process analysis. e.g., when enacting a chemical reaction, the characteristics of a warm-up phase might be important for the

Figure 2: Example Process. outcome but might not be explicitly part of the process model, which only starts with adding ingredients. Please note that being connected to \"group of activities\" or \"traces\" can also include that one sensor reading can be relevant for very different processes or process instances or activities in very different process or process instances. We assume that the readings are duplicated for these cases--we focus on single instances and their activities. As each reading can be uniquely identified, complex relationships between instances and processes will still be visible in the data. In order to realize these three contexts, we extend XES as depicted in Figure 4.

Figure 4: XES + DataStream Metamodel Extension. Figure 3: Different Contexts in Which IoT Data Can Be Collected.