# DataStream XES Extension: Embedding IoT Sensor Data into Extensible Event Stream Logs
## 2 Foundations and Related Work
### Process Mining
Then a third set of stream:point attributes might be connected to all tasks in groups (a) and (b), leading to a (c: (a) (b)) nesting, as depicted in Listing 2:
```
1<trace>
2<stringkey=\"concept:name\"value=\"Process1\"/>
3<listkey=\"stream:datacontext\">
4<listkey=\"stream:datastream\">
5<listkey=\"stream:point\">
6<datekey=\"stream:timesdumpvalue=\"2021-11-04T15:22:19.367+01:00\"/>
7<stringkey=\"stream:id\"value=\"humidity\"/>
8<stringkey=\"stream:value\"value=\"62.5\"/>
9</list>
10</list>
11[...]
12<listkey=\"stream:datacontext\">
13<listkey=\"stream:datastream\">
14<listkey=\"stream:point\">
15<datekey=\"stream:timesdumpvalue=\"2021-11-04T15:22:22.369+01:00\"/>
16<stringkey=\"stream:id\"value=\"pressure\"/>
17<intstringkey=\"stream:value\"value=\"19\"/>
18</list>
19[...]
20</list>
21<event>[...]</event>
22<event>[...]</event>
23[...]
24</list>
25<listkey=\"stream:datacontext\">
26<listkey=\"stream:datastream\">
27<listkey=\"stream:point\">
28<datekey=\"stream:timesdumpvalue=\"2021-11-04T15:22:28.369+01:00\"/>
29<stringkey=\"stream:id\"value=\"temperature\"/>
30<intstringkey=\"stream:value\"value=\"75.3\"/>
31</list>
32[...]
33</list>
34<event>[...]</event>
35<event>[...]</event>
36[...]
37</list>
38</list>
39</trace>
40</log>
```
This leaves us with the special case of overlapping cases, where some stream:points are connected to tasks 1 and 2, where some other stream:points are connected to tasks 2 and 3. This case can only (XES being a tree structure) be solved by creating three stream:datastream attributes with some duplicated stream:point elements. ### Task Lifecycle Extension: Stream/Data

For long-running tasks, especially when adding IoT data at runtime, it is beneficial to add the IoT data immediately to the XES log, instead of waiting for the next event to occur. For example, if IoT sensors deliver data during the execution of a task with a duration of 90 min, all data would occur in the \"lifecycle:transition complete\" event. If the XES log is processed at runtime, e.g., for runtime drift analysis such as in [47], this would prevent early availability of analysis results. Thus, the introduction of a new lifecycle transition named **stream/data**, as shown in Listing 3, allows the immediate addition of data to the log. The event might optionally include the context (i.e., id of the task), or not include the context if the event exists at the trace or log level. ```
1<trace>
2<stringkey=\"concept:name\"value=\"Process1\"/>
3<event>
4<stringkey=\"lifecycle:transition\"value=\"start\"/>
5...
6<event>
7<event>
8<stringkey=\"lifecycle:transition\"value=\"stream/data\"/>
9<listkey=\"stream:dataset\">
10...
11</list>
12...
13<event>
14...
15<event>
16<stringkey=\"lifecycle:transition\"value=\"complete\"/>
17...
18<event>
19...
20</trace>
21</log>
```
Listing 3: Sample XES (XML serialization) stream/data. ### Convenience and Size: Stream:Multipoint

The final element introduced in Figure 4 is stream:multipoint. This concept is not necessary from a functional perspective, but allows reducing the size of the log file. For example, when a set of sensor:point attributes all origin from the same sensor and the same source, and contain the same meta information, this information is duplicated all over and over.