Object-centric Process Mining Model: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
 
(68 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div style="border:1px solid #dfdfdf;padding:0.5em 1em 0.5em 1em;background-color:#E7EAEC;margin:10px 0px 0px 10px;">
QPR ProcessAnalyzer supports object-centric process mining (OCPM) based on the OCEL 2.0 standard (https://www.ocel-standard.org). To use object-centric functionality, you need to transform data into the [[#Object-centric_model_structure|suitable format]] for the [[#Create_object-centric_model|object-centric model]]. Object-centric models can be analyzed in the object-centric flowchart and with (case-centric) charts because the object-centric model can be converted into a case-centric eventlog using [[#Object-centric_perspectives|perspectives]]. To use the OCPM functionality, Snowflake needs to be used as the calculation engine.
This page describes functionality that hasn't fully been released.
</div>


QPR ProcessAnalyzer supports object-centric process mining models (OCPM) based on the OCEL 2.0 standard (https://www.ocel-standard.org).
== Create object-centric model ==
== Create OCPM model ==
Create a new object-centric model as follows:
New OCPM model is created as follows:
# In the Workspace, open the project where to create the model.
# In the Workspace, open the project where to created the model.
# Select '''NEW"''' in the top right menu and select '''model'''.
# Select "NEW" in top right menu and select "OCPM model"
# Define a name for the new model.
# Define a name for the new model and click '''Create'''.
# Set '''Model type''' as '''Object-centric'''.
# Click '''Create'''.


== Configure OCPM model datatables ==
== Configure object-centric model datatables ==
Datatables for the OCPM model can be configured as follows:
Datatables for the object-centric model need to exist in the same project as the model. Datatables can be set for the model as follows:
# In the Workspace, select the OCPM model and click '''Properties'''.
# In the Workspace, select the object-centric model and click '''Properties'''.
# In the dialog, open the '''Datasource''' tab.
# In the model properties dialog, open the '''Datasource''' tab.
# Add following kind of configuration to the textbox:
# Add a following kind of json configuration to the textbox:
<pre>
<pre>
{  
{
   "OcelDataSource": {
   "Objects": "OCPM: objects",
    "Events": "ocpm_model - events",  
  "Events": "OCPM: events",
    "EventTypes": {
  "ObjectToObject": "OCPM: object-object",
      "Approve Purchase Requisition": "ocpm_model - eventtype-Approve Purchase Requisition",  
  "EventToObject": "OCPM: event-object",
      "Change PO Quantity": "ocpm_model - eventtype-Change PO Quantity",  
  "ObjectTypes": {
      "Create Purchase Order": "ocpm_model - eventtype-Create Purchase Order",  
    "Invoice": "OCPM object: Invoice",
      "Create Purchase Requisition": "ocpm_model - eventtype-Create Purchase Requisition",
    "Payment": "OCPM object: Payment",
      "Insert Invoice": "ocpm_model - eventtype-Insert Invoice",  
    "Purchase Order": "OCPM object: Purchase Order"
      "Insert Payment": "ocpm_model - eventtype-Insert Payment",  
  },
      "Remove Payment Block": "ocpm_model - eventtype-Remove Payment Block",
  "EventTypes": {
      "Set Payment Block": "ocpm_model - eventtype-Set Payment Block"  
     "Approve Purchase Requisition": "OCPM event: Approve Purchase Requisition",
    },  
    "Change PO Quantity": "OCPM event: Change PO Quantity",
    "Objects": "ocpm_model - objects",
    "Create Purchase Order": "OCPM event: Create Purchase Order",
     "ObjectTypes": {
    "Insert Invoice": "OCPM event: Insert Invoice",
      "Invoice": "ocpm_model - objecttype-Invoice",  
     "Insert Payment": "OCPM event: Insert Payment"
      "Payment": "ocpm_model - objecttype-Payment",  
   }
      "Purchase Order": "ocpm_model - objecttype-Purchase Order",  
}
      "Purchase Requisition": "ocpm_model - objecttype-Purchase Requisition"  
    },  
     "EventToObject": "ocpm_model - event-object",
    "ObjectToObject": "ocpm_model - object-object"  
   }  
}  
</pre>
</pre>


== Import from OCEL file ==
The json configuration needs to have following properties:
* '''Objects''': Objects datatable name.
* '''Events''': Events datatable name.
* '''ObjectToObject''': Object-to-object relation datatable name.
* '''EventToObject''': Event-to-object relation datatable name.
* '''ObjectTypes''': Key-value-pairs of object type datatable names. Note that object names need to match with object names in the objects datatable.
* '''EventTypes''': Key-value-pairs of event type datatable names. Note that event names need to match with event names in the events datatable.
 
== Import from OCEL 2.0 JSON file ==
Object-centric model can be import from an OCEL 2.0 JSON file as follows:
# In the Workspace, open the project where to import the model.
# Select '''NEW''' in top right menu and select '''Import Model'''.
# Select the OCEL 2.0 JSON file from the disk and click '''Open'''.
 
An object-centric model and a list of datatables is created.
 
Example OCEL 2.0 eventlogs: https://www.ocel-standard.org/event-logs/overview/ (download the json format supported by QPR ProcessAnalyzer)
 
== Object-centric model structure ==
Object-centric model contains datatables described in the table below. Datatables can be named freely, as the model json configuration is used to define the datatable for each type of data. The datatables need to use column names specified in the table below because those are the column names assumed by the object-centric (i.e., column names cannot be selected freely).


== OCPM model structure ==
OCPM model has the following tables:
{| class="wikitable"
{| class="wikitable"
!'''Datatable'''
!'''Datatable role'''
!'''Content'''
!'''Contained data'''
! '''Columns'''
! '''Datatable columns'''
|-
|-
||Events
||Objects
||
||Objects in the model (one row per object).
||
||
* '''OcelEventId'''
* '''OcelObjectId''': Unique id for the object (among all objects in the model).
* '''OcelEventType'''
* '''OcelObjectType''': Object type name (such as Order, Invoice, Delivery). Note that the model json configuration need to use same object type names.
* '''OcelEventTime'''
|-
|-
||Objects
||Events
||Events in the model (one row per event).
||
||
||
* '''OcelEventId''': Unique id for the event (among all events in the model).
* '''OcelObjectId'''
* '''OcelEventType''': Event type name (such as Order created, Invoice sent). Note that the model json configuration need to use same event type names.
* '''OcelObjectType'''
* '''OcelEventTime''': Event timestamp.
|-
|-
||EventToObject
||Object-object relations
||Relations between objects (one row per relation).
||
||
||
* '''OcelObjectObjectSourceId''': Source object id in the relation.
* '''OcelEventObjectSourceId'''
* '''OcelObjectObjectTargetId''': Target object id in the relation.
* '''OcelEventObjectTargetId'''
* '''OcelObjectObjectQualifier''': Describes the type of the relation as free-form text (not used currently).
* '''OcelEventObjectQualifier'''
|-
|-
||ObjectToObject
||Event-object relations
||Relations between events and objects (one row per relation).
||
||
||
* '''OcelEventObjectSourceId''': Object id in the relation.
* '''OcelObjectObjectSourceId'''
* '''OcelEventObjectTargetId''': Event id in the relation.
* '''OcelObjectObjectTargetId'''
* '''OcelEventObjectQualifier''': Describes the type of the relation as free-form text (not used currently).
* '''OcelObjectObjectQualifier'''
|-
|-
||Event types
||Object attributes (several datatables)
||
||Object attribute values, each object type in a separate table (one row per object).
||
||
* '''OcelEventTypeEventId'''
* '''OcelObjectTypeObjectId''': Object id. Matches to the objects datatable ''OcelObjectId'' column.
* Other event type related fields
* '''OcelObjectTypeTime''': Timestamp which the attribute value is valid from (not used currently).
* '''OcelObjectTypeChangedField''': Changed object attribute name (not used currently).
* '''<Object attributes>''': Columns for each of the object attribute values (column name is the object attribute name).
|-
|-
||Object types
||Event attributes (several datatables)
||
||Event attribute values, each event type in a separate table (one row per event).
||
||
* '''OcelObjectTypeObjectId'''
* '''OcelEventTypeEventId''': Event id. Matches to the events datatable ''OcelEventId'' column.
* '''OcelObjectTypeTime'''
* '''<Event attributes>''': Columns for each of the event attribute values (column name is the event attribute name).
* '''OcelObjectTypeChangedField'''
* Other object type related fields
|}
|}


Datatables can be named freely, but the column names are predefined.
== Object-centric perspectives ==
Perspectives convert an object-centric model into the traditional case-centric eventlog, allowing to view and analyze object-centric models in analyses provided by charts. A single perspective is not able describe the object-centric model entirely, but just from a certain limited viewpoint. By using analyses with several perspectives, it's possible to get a more complete picture of the object-centric model. The perspective starts from a certain object type and traverses the object-object relations as many steps as desired.


== Perspectives ==
To define a perspective, the following settings are defined in the chart settings:
OCPM perspective provides means to "project" OCPM/OCEL model into a single tabular representation based on provided additional configurations, which can then be more easily analyzed using, e.g., traditional analysis methods used for event- and case-table based event logs.
* '''Base Object type''': Object of this type will be cases in the projected case-centric eventlog.
* '''Object Relation Steps''': Specifies how many object-object relations will be traversed in order to find events connected to the base objects. Value zero means that only those events are returned that are directly connected to the base objects.
* '''Show Event Types''': List of event type names which are included into the perspective eventlog. If no events are explicitly defined, all events will be included, but their event attributes are not included.


Perspective configuration supports the following properties and their values:
The resulting perspective eventlog will have the following columns:
* ObjectType: The name of the object type, specifying the type of the object that all events should be projected to.
* '''OcelObjectId''' (mapped to case id)
* EventTypes: An array of event type names whose attributes are to be included into the resulting projected event log. If not defined, all the events in the OCEL model will be included, but their type-specific attributes are not included.
* '''OcelEventType''' (mapped to event type)
* Recursion depth: Specifies how many object-to-object relations are to be traversed in order to find events connected to the specified object type. Default value is 0, which means that only those events are returned that are directly connected to objects of the specified object type (based on EventToObject table).
* '''OcelEventTime''' (mapped to timestamp)
* '''OcelEventId'''
* Object attributes of the base object type. Note that the object attribute values are "repeated" for all events belonging to the same object.
* Event attributes of the selected event types. Values are null for events that don't have the attribute.


3. Perspective is applied as follows:
The base object type attributes are available as case attributes. As the object attribute values may change over time in the OCEL 2.0 data, the last attribute value is used as the case attribute value. Note that other object type's attributes are not available as case attributes, so the object for which the attributes are used, need to be set as the base object.
3.1. First, take all the rows from events-table.
3.2. For every event row, collect all the related objects based on EventToObject-table.
3.3. For every event + object combination, do the following:
3.3.1. Set current recursion depth to 0.
3.3.2. If the object is of the object type specified in the perspective, keep this event + object combination.
3.3.3. Otherwise:
3.3.3.1. If the current recursion depth is smaller than the configured RecursionDepth, generate all event + object combinations of all the objects related to the object of the current one based on ObjectToObject-table. For each such event + related object combination, continue to 3.3. above while increasing the recursion depth by one.
3.3.3.2. If the current recursion depth equals the configured RecursionDepth, the result will not include this row + object combination.
3.4. For each remaining event + object row:
3.4.1. Join all the columns (if there are any) from configured ObjectType's-table.
3.4.2. Join all the columns (if there are any) from each configured EventType's-table.
3.4.2.1. If EventType-table does not have some column that exists in some other joined EventType's column, that column will get a null value.


Example:
== Save perspective to filter ==
It's possible to include the object-centric perspective to a stored filter. When a filter is selected, also the perspective in the filter is applied to the dashboard. This allows to quickly change perspectives for the entire dashboard. The chart specific perspective overrides the dashboard level perspective, so the dashboard level perspective is only applied for charts that don't have the chart specific perspective defined.
 
Perspective can be added to a filter as follows:
# Go to the ''Process Discovery'' dashboard.
# Open the ''Session variables'' dialog in the dots menu on top right.
# Paste the filter json to the ''Value'' of the ''Filter'' variable (it might be easiest to start with a filter without filter rules, and then add the filter rules using the UI).
# Click ''Done'' button for the dialog.
# Save the filter by hovering the ''Unsaved filter'' (filters dropdown list) in the header and click ''Save as new filter''.
 
Example: Filter json without any filter rules:
<pre>
{
{
   "ObjectType": "Payment",
   "Items": [],
   "EventTypes": ["Approve Purchase Requisition", "Change PO Quantity", "Create Purchase Order", "Create Purchase Requisition", "Insert Invoice", "Insert Payment", "Remove Payment Block", "Set Payment Block"],
   "Perspective": {
  "RecursionDepth": 2
    "ObjectType": "Container",
    "RecursionDepth": 0
  }
}
}
</pre>


Generates a projection where resulting rows, each representing one event, are mapped to objects of type "Payment". If an event in OCEL model is not connected to Payment-object, even after performing two iterations of searches via ObjectToObject-table rows), that event will not show up in the result.
Example: Filter json with a filter rule:
 
<pre>
The result will have the following columns:
{
OcelEventId (primary key)
  "Items": [
OcelObjectId (primary key)
    {
OcelEventTime
      "Type": "IncludeEvents",
<all the object type specific columns found in Payment object type table>
      "Items": [
<all the event type specific columns found in all the 8 event types listed in EventTypes-property>
        {
          "Type": "Attribute",
          "Attribute": "OcelEventId",
          "StringifiedValues": [ "0Event 1" ]
        }
      ]
    }
  ],
  "Perspective": {
    "ObjectType": "Container",
    "RecursionDepth": 0
  }
}
</pre>


== Differences to OCEL 2.0 standard ==
== Differences to OCEL 2.0 standard ==
Main changes to the proposed implementation:  
Object-centric models in QPR ProcessAnalyzer are mainly following the OCEL 2.0 standard, but there are the following differences:
* ocel_time-field of each event type table is moved to event-table (as every event anyways has a timestemp).  
* Changing of object attributes values over time is not supported.
* *_map_type are not needed as we can use model configuration for the same purpose.  
* ''ocel_time'' field of each event type table is moved to events datatable (as every event has a timestemp).  
* ObjectType-tables: If OcelObjectTypeChangedField is not null, all the other field values are copied from the previous entry having the same OcelObjectTypeObjectId, except:  
* ''*_map_type'' columns are not needed as the model settings are used for the same purpose.  
** OcelObjectTypeChangedField, which has the name(s) of the changed field(s) as comma separated string.  
* Object type tables: If OcelObjectTypeChangedField is not null, all the other field values are copied from the previous entry except:  
** The actual changed field, which has the new value.  
** ''OcelObjectTypeChangedField'' which has the names of the changed fields as a comma separated string.  
** OcelObjectTypeTime, which has the timestamp when the value changed.
** The actual changed field which has the new value.  
** ''OcelObjectTypeTime'' which has the timestamp when the value changed.

Latest revision as of 08:44, 14 November 2024

QPR ProcessAnalyzer supports object-centric process mining (OCPM) based on the OCEL 2.0 standard (https://www.ocel-standard.org). To use object-centric functionality, you need to transform data into the suitable format for the object-centric model. Object-centric models can be analyzed in the object-centric flowchart and with (case-centric) charts because the object-centric model can be converted into a case-centric eventlog using perspectives. To use the OCPM functionality, Snowflake needs to be used as the calculation engine.

Create object-centric model

Create a new object-centric model as follows:

  1. In the Workspace, open the project where to create the model.
  2. Select NEW" in the top right menu and select model.
  3. Define a name for the new model.
  4. Set Model type as Object-centric.
  5. Click Create.

Configure object-centric model datatables

Datatables for the object-centric model need to exist in the same project as the model. Datatables can be set for the model as follows:

  1. In the Workspace, select the object-centric model and click Properties.
  2. In the model properties dialog, open the Datasource tab.
  3. Add a following kind of json configuration to the textbox:
{
  "Objects": "OCPM: objects",
  "Events": "OCPM: events",
  "ObjectToObject": "OCPM: object-object",
  "EventToObject": "OCPM: event-object",
  "ObjectTypes": {
    "Invoice": "OCPM object: Invoice",
    "Payment": "OCPM object: Payment",
    "Purchase Order": "OCPM object: Purchase Order"
  },
  "EventTypes": { 
    "Approve Purchase Requisition": "OCPM event: Approve Purchase Requisition",
    "Change PO Quantity": "OCPM event: Change PO Quantity",
    "Create Purchase Order": "OCPM event: Create Purchase Order",
    "Insert Invoice": "OCPM event: Insert Invoice",
    "Insert Payment": "OCPM event: Insert Payment"
  }
}

The json configuration needs to have following properties:

  • Objects: Objects datatable name.
  • Events: Events datatable name.
  • ObjectToObject: Object-to-object relation datatable name.
  • EventToObject: Event-to-object relation datatable name.
  • ObjectTypes: Key-value-pairs of object type datatable names. Note that object names need to match with object names in the objects datatable.
  • EventTypes: Key-value-pairs of event type datatable names. Note that event names need to match with event names in the events datatable.

Import from OCEL 2.0 JSON file

Object-centric model can be import from an OCEL 2.0 JSON file as follows:

  1. In the Workspace, open the project where to import the model.
  2. Select NEW in top right menu and select Import Model.
  3. Select the OCEL 2.0 JSON file from the disk and click Open.

An object-centric model and a list of datatables is created.

Example OCEL 2.0 eventlogs: https://www.ocel-standard.org/event-logs/overview/ (download the json format supported by QPR ProcessAnalyzer)

Object-centric model structure

Object-centric model contains datatables described in the table below. Datatables can be named freely, as the model json configuration is used to define the datatable for each type of data. The datatables need to use column names specified in the table below because those are the column names assumed by the object-centric (i.e., column names cannot be selected freely).

Datatable role Contained data Datatable columns
Objects Objects in the model (one row per object).
  • OcelObjectId: Unique id for the object (among all objects in the model).
  • OcelObjectType: Object type name (such as Order, Invoice, Delivery). Note that the model json configuration need to use same object type names.
Events Events in the model (one row per event).
  • OcelEventId: Unique id for the event (among all events in the model).
  • OcelEventType: Event type name (such as Order created, Invoice sent). Note that the model json configuration need to use same event type names.
  • OcelEventTime: Event timestamp.
Object-object relations Relations between objects (one row per relation).
  • OcelObjectObjectSourceId: Source object id in the relation.
  • OcelObjectObjectTargetId: Target object id in the relation.
  • OcelObjectObjectQualifier: Describes the type of the relation as free-form text (not used currently).
Event-object relations Relations between events and objects (one row per relation).
  • OcelEventObjectSourceId: Object id in the relation.
  • OcelEventObjectTargetId: Event id in the relation.
  • OcelEventObjectQualifier: Describes the type of the relation as free-form text (not used currently).
Object attributes (several datatables) Object attribute values, each object type in a separate table (one row per object).
  • OcelObjectTypeObjectId: Object id. Matches to the objects datatable OcelObjectId column.
  • OcelObjectTypeTime: Timestamp which the attribute value is valid from (not used currently).
  • OcelObjectTypeChangedField: Changed object attribute name (not used currently).
  • <Object attributes>: Columns for each of the object attribute values (column name is the object attribute name).
Event attributes (several datatables) Event attribute values, each event type in a separate table (one row per event).
  • OcelEventTypeEventId: Event id. Matches to the events datatable OcelEventId column.
  • <Event attributes>: Columns for each of the event attribute values (column name is the event attribute name).

Object-centric perspectives

Perspectives convert an object-centric model into the traditional case-centric eventlog, allowing to view and analyze object-centric models in analyses provided by charts. A single perspective is not able describe the object-centric model entirely, but just from a certain limited viewpoint. By using analyses with several perspectives, it's possible to get a more complete picture of the object-centric model. The perspective starts from a certain object type and traverses the object-object relations as many steps as desired.

To define a perspective, the following settings are defined in the chart settings:

  • Base Object type: Object of this type will be cases in the projected case-centric eventlog.
  • Object Relation Steps: Specifies how many object-object relations will be traversed in order to find events connected to the base objects. Value zero means that only those events are returned that are directly connected to the base objects.
  • Show Event Types: List of event type names which are included into the perspective eventlog. If no events are explicitly defined, all events will be included, but their event attributes are not included.

The resulting perspective eventlog will have the following columns:

  • OcelObjectId (mapped to case id)
  • OcelEventType (mapped to event type)
  • OcelEventTime (mapped to timestamp)
  • OcelEventId
  • Object attributes of the base object type. Note that the object attribute values are "repeated" for all events belonging to the same object.
  • Event attributes of the selected event types. Values are null for events that don't have the attribute.

The base object type attributes are available as case attributes. As the object attribute values may change over time in the OCEL 2.0 data, the last attribute value is used as the case attribute value. Note that other object type's attributes are not available as case attributes, so the object for which the attributes are used, need to be set as the base object.

Save perspective to filter

It's possible to include the object-centric perspective to a stored filter. When a filter is selected, also the perspective in the filter is applied to the dashboard. This allows to quickly change perspectives for the entire dashboard. The chart specific perspective overrides the dashboard level perspective, so the dashboard level perspective is only applied for charts that don't have the chart specific perspective defined.

Perspective can be added to a filter as follows:

  1. Go to the Process Discovery dashboard.
  2. Open the Session variables dialog in the dots menu on top right.
  3. Paste the filter json to the Value of the Filter variable (it might be easiest to start with a filter without filter rules, and then add the filter rules using the UI).
  4. Click Done button for the dialog.
  5. Save the filter by hovering the Unsaved filter (filters dropdown list) in the header and click Save as new filter.

Example: Filter json without any filter rules:

{
  "Items": [],
  "Perspective": {
    "ObjectType": "Container",
    "RecursionDepth": 0
  }
}

Example: Filter json with a filter rule:

{
  "Items": [
    {
      "Type": "IncludeEvents",
      "Items": [
        {
          "Type": "Attribute",
          "Attribute": "OcelEventId",
          "StringifiedValues": [ "0Event 1" ]
        }
      ]
    }
  ],
  "Perspective": {
    "ObjectType":  "Container",
    "RecursionDepth": 0
  }
}

Differences to OCEL 2.0 standard

Object-centric models in QPR ProcessAnalyzer are mainly following the OCEL 2.0 standard, but there are the following differences:

  • Changing of object attributes values over time is not supported.
  • ocel_time field of each event type table is moved to events datatable (as every event has a timestemp).
  • *_map_type columns are not needed as the model settings are used for the same purpose.
  • Object type tables: If OcelObjectTypeChangedField is not null, all the other field values are copied from the previous entry except:
    • OcelObjectTypeChangedField which has the names of the changed fields as a comma separated string.
    • The actual changed field which has the new value.
    • OcelObjectTypeTime which has the timestamp when the value changed.