Example Collection
This page contains a collection of query examples, using different functionality of the OCPQ tool. For each example, you can view the graphical representation as an image. Using the -button, the constraint or query can be copied to your clipboard and can afterwards be pasted in the query editor of OCPQ using Ctrl+v. Make sure to first focus the editor, e.g., by clicking on it or on an existing node.

The following examples are organized based on the object-centric dataset used.
Order Management
The Order Management OCEL describes customer order management, including order placement, packaging and shipping, and payment handling. It can be downloaded here. The dataset contains 34,303 events and 5,231 objects.
A constraint modeling that no payment reminder should be sent out after payment has been made.
In particular, for any combination of related order, payment reminder, and pay order event, the payment reminder should always have occurred before the pay order event.

A constraint modeling that orders with at most 10 items should be paid within three weeks after placement.

A constraint modeling that orders should be delivered fully within 3.5 weeks.
Notice the difference between the violation status of the top and bottom node: The bottom node is violated for each item that was delivered too late. The top node is violated for an order, if any of its items was delivered too late, leading, in this case, to a higher violation percentage.

A query identifying customers that had at least 5 orders for which at least two payment reminder had to be sent out.

A query calculating the total order volume of customers (i.e., the sum of all order prices by the customer for which payment is recorded). All customers with a total order volume below 300,000€ are shown as violating.
This query uses the CEL scripting feature to calculate the sum of the orders, using the following CEL snippet:
A.map(b,b['o2'].attr('price')).sum().int()
Finally, an Advanced CEL Script1 is used for the constraint, i.e., order_volume >= 300000
.

BPIC 2017
The examples below use the real-life BPI Challenge 2017 dataset (Original Source). A ready-to-use OCEL 2.0 file for this dataset can be obtained from here, by extracting the zip file. The dataset is rather large, containting 2,043,141 events and 34,412 objects.
A selection of the example queries presented below originate from a performance evaluation of OCPQ.
After an Application was accepted, at least one resulting Offer for that application should also be accepted.

The same Case Resource (Case_R) that accepted an Application, should also create all the resulting Offers.

What is the maximum duration between an Offer being created to getting accepted?
To calculate the duration, the following CEL query is used:
string(max(A.map(b,b['e2'].time() - b['e1'].time())))
In the dataset, the query yields 3140h7m38s
as a result (i.e., 130 days 20 hours 7 minutes and 38 seconds).

Footnotes
-
In contrast to a regular CEL Script as a filter or constraint, the advanced version is executed after the basic filters, constraints and labels were already computed. Thus, added CEL labels can only be used in advanced CEL scripts. ↩