R Tutorial : Components of process data

Learn the building blocks of event logs in R: activities, cases, activity instances, events, and resources. A patient registration and X-ray example shows how multiple timestamped events with different lifecycle statuses (schedule, start, complete) make up a single activity instance. Create event-log objects using the bupaR package's eventlog() function.
Chapters
So far, we are already familiar with two important components in a the activities which are the steps undertaken in the process, the actions and the cases which are the objects flowing through the process on which the actions are performed. In this lesson, we will learn about the distinction between activity instances and events and the transactional lifecycle in the process. At the end of this chapter, you will be able to define your own event data objects in R. When a specific action takes place for a specific case, this is called an activity instance, the execution of an activity in a specific context at a certain point in time. In this example, we see three activity instances containing two different activities, registration and X ray, and two different patients, Emily and John. In this example, we can see the time at which both the registration and the X ray started. However, activities rarely happen instantly they usually take some time. An activity instance therefore, can consist of a series of events. If we take a closer look at the X ray activity execution for John, we would see that it was scheduled during registration at 9:51. It actually started at 10:42 and was finished at 10:58. Each of these time recordings is called an event. One or more events together can form an activity instance. Three in this case, the type of event schedule start complete is called the lifecycle status. In reality, there can be many different assign, schedule, start, suspend, resume, abort. For simplicity, we will only use the most common ones in this course. Start and complete. A logbook of events is called an event log. For our current example, the event log looks as shown here. There are two registration instances for which only a start event is recorded the arrival of the patient and there is one X ray instance which consists of three events. Another component of process data are the resources. As you can recall, resources are the actors in the process. They perform the activities. In this course, we always assume that the complete activity instance, that is all the related events, are executed by one and only one resource. In our example there are three Mr. Owens and Mr. Fleming who performed the registration of John and Emily, respectively, and Dr. Russell who performed the X ray. We now have all the ingredients for our process. A list of events with six different characteristics for each a case identifier, an activity label, an activity instance identifier, a timestamp, a lifecycle status and and the resource identifier. In R. An event log object is created using the event log function from the BUPA package, which takes a dataframe with events as input and returns a log object as output in the dataframe. Each of the ingredients we just saw should be present as a variable in the event log function, we can specify each of the ingredients by referring to the variable names in the data frame. Once the event log object is created, we can start analyzing our process data in in the next step. Now it's your turn. Let's see whether you can identify the different components in the process and define events.
More from Richie

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon







