# ocpa: A Python library for object-centric process analysis

- Type: Journal article
- URL: https://www.gyunam.com/publication/2023-softwareimpact/
- Date: 2022-11-01
- Authors: Jan Niklas Adams, Gyunam Park, Wil M. P. van der Aalst
- Venue: Softw. Impacts
- DOI: https://doi.org/10.1016/j.simpa.2022.100438
- PDF: https://www.gyunam.com/publication/2023-softwareimpact/paper.pdf
- Link (URL): https://doi.org/10.1016/j.simpa.2022.100438
- Research lines: [Object-centric process mining](https://www.gyunam.com/research-line/object-centric-process-mining/index.md)

## Abstract

ocpa is a Python library supporting object-centric process mining. Traditional process mining generate insights for one single process. However, many real-life processes are composed of multiple interacting subprocesses and events may involve multiple objects. Object-centric process mining provides techniques for analyzing multiple interacting processes by generalizing process mining techniques. ocpa contains algorithms for object-centric event log management, process discovery, conformance checking, enhancement, and predictive process monitoring. ocpa is easily integrable with existing solutions as it supports existing object-centric event log standards, provides extensive documentation, and is installable through the Python package installer.

## Practical problem

Process mining tools assume that one execution of a process is a sequence of events belonging to a single case. In an ERP (enterprise resource planning) system an order involves several documents, and in a factory many parts are produced separately and assembled later, so events are shared between objects and the behaviour forms a graph rather than a sequence. To use existing tools, analysts flatten the data onto one case notion, which duplicates events, makes events disappear and introduces false dependencies between activities. Techniques that avoid flattening have been published as separate research prototypes, so practitioners and researchers have had no single platform to apply object-centric discovery, conformance checking, performance analysis and prediction together.

## Research questions

1. How can the object-centric process mining techniques proposed in recent years be bundled into one library that works on object-centric event logs without flattening?
2. How can such a library integrate with existing event log standards and the Python ecosystem so that practitioners and researchers can adopt it?

## Contributions

- `ocpa`, an open-source Python library (GPL-3.0, GitHub `ocpm/ocpa`, installable with pip, documented on readthedocs, with a Code Ocean capsule) for object-centric process mining.
- A data management submodule that imports CSV, JSON-OCEL and XML-OCEL (Object-Centric Event Log) files into an OCEL class, derives process executions, variants and statistics, and exports JSON-OCEL.
- Algorithms for discovering object-centric Petri nets and variant graphs, computing precision and fitness, and monitoring control-flow, object involvement and performance constraints.
- Model-based object-centric performance analysis (flow, synchronization, pooling and lagging time plus waiting, service and sojourn time) and feature extraction with table, sequence and graph encodings for predictive monitoring.
- A visualization submodule with GraphViz rendering of object-centric Petri nets and a dedicated layout algorithm for variant graphs.

## Key findings

- The paper is a software description without experiments; it documents version 1.0.0 of the library, built on pandas, numpy, pm4py, networkx and graphviz.
- It argues that the library is the first unified platform covering all four process mining tasks on graph-structured event data, implementing techniques from roughly two years of prior research.
- It argues the library enables new research questions, such as clustering object-centric data and comparing predictive models, and supports applied use in finance, manufacturing and service sectors as vendors begin to adopt object-centric data.


