Plugin Evaluation¶
In this evaluation, we implement a new plugin for Ocelescope that discovers object-centric directly-follows graphs. This serves as a test case to assess how easy it is to develop and integrate plugins using the provided system and documentation.
Step 1: Setup¶
To begin evaluating the Ocelescope plugin system, start by setting up your development environment using one of the following methods.
Clone or Scaffold the Minimal Plugin Template¶
You can either clone the minimal template repository or generate a new project using the cookiecutter template.
Install Dependencies¶
Install all required dependencies using your preferred method:
Locate the Plugin Entry Point¶
Navigate to the following file, which contains the initial plugin skeleton:
Below is the content of the minimal plugin template:
Step 2: Implement the Plugin¶
The goal of this step is to implement a new plugin that discovers an object-centric directly-follows graph (OC-DFG).
The plugin should:
- Take an OCEL as input.
- Accept a list of object types as parameters.
- Compute the OC-DFG using these parameters.
- Return the result as a Resource.
Step 2.1: Rename the Plugin Class¶
Rename the class MinimalPlugin
to a meaningful name such as DiscoverDFG
.
Update the label and description accordingly.
Adapt the import in src/minimal_plugin/__init__.py
to reflect the new class name.
Step 2.2: Rename the Plugin Method¶
Rename the method example
to a descriptive name such as discover
.
Update the metadata fields label
and description
.
Step 2.3: Extend the Input Class¶
Extend the Input class by adding a new field that captures a list of object types. Use the OCEL_FIELD
helper to define this field and link it to the OCEL input.
Refer to the Plugin Development Guide for details on defining OCEL-dependent selection fields.
Warning
Make sure the ocel_id
in OCEL_FIELD
matches the ocel
parameter of the function.
Step 2.4: Create a Custom Resource¶
The discovery method returns the object-centric directly-follows graph (OC-DFG) as a list of triplets:
These represent direct-follow relationships between events for a given object type. Start and end edges are represented using None
:
- Start edges:
(None, object_type, event)
- End edges:
(event, object_type, None)
To integrate this into the plugin system, define a custom resource to hold this data.
- Rename the class MinimalResource to DFG.
- Update the label and description to reflect that the resource represents an object-centric directly-follows graph.
- Add a field edges with the following type:
- Update the return type of the plugin method so that it returns the new DFG resource.
Refer to the Plugin Development Guide or the tutorial for more details on defining custom resources
Step 2.5: Add a Visualization¶
You already implemented a helper function (convert_dfg_to_graphviz
) that creates a Graphviz Digraph representation of your object-centric directly-follows graph (OC-DFG).
Visualization Method
Now, the goal is to reuse this function inside your Ocelescope resource so the OC-DFG can be displayed directly in the UI.
What to Do (Inside the visualize
method):
-
Generate the Digraph Call
convert_dfg_to_graphviz
with your DFG data to produce agraphviz.Digraph
. -
Convert to DotVis Wrap the resulting
Digraph
in aDotVis
usingDotVis.from_graphviz(...)
. See docs. -
Choose an appropriate Graphviz layout engine (e.g.,
"dot"
). - Return the visualization Update visualize to return the
DotVis
object, and change its signature to-> DotVis
.
Step 2.6: Integrate the Implementation¶
Modify your plugin method so that it calls the provided discovery function to compute the object-centric directly-follows graph based on the selected object types.
Then, return an instance of the DFG resource, assigning the discovered edges to its edges field.
Discover Function
Step 3: Build your plugin¶
Use the provided build script to package your plugin so it can be used in Ocelescope.
From the root of your plugin project, run:
This will generate a plugin as a .zip
in the dist/
directory.
Upload this ZIP file in the Ocelescope interface to test your plugin.
You can return to the evaluation form to complete the assessment.