Constraint Guide
Constraints are conditions that every binding of a box should satisfy. OCPQ evaluates them for each binding and reports which bindings violate them. In this guide, we check whether orders are paid within 5 days after they were placed.
Start
For that, first follow the Query Guide to load the Order Management OCEL and create a query.
Our box contains an object variable o1 of type orders and two event variables, e1 for place order and e2 for pay order, which are both connected to o1 through an E2O filter.

Adding a Constraint
To add a constraint, click on the + next to Constraints 1.

The dialog offers the same predicate types as for filters.
We select Time Between Events (TBE) 1, which compares the timestamps of two event variables.
Its configuration reads as a sentence, i.e., e2 (pay order) happens at most 2 5 days 3 after 4 e1 (place order).
Instead of at most, you can also choose at least, between, within, or a range with optional open ends.
Below the sentence, a preview shows how the constraint will appear in the box.
As the dialog was opened from the constraints section, Use as 5 is already set to Constraint.
Finally, Add 6 saves the constraint.

Evaluating Constraints
The box now shows the constraint as an arrow from e1 to e2, labeled with the 5-day bound.

Next, evaluate the query using the play button, as described in the Query Guide. Boxes with constraints are colored based on their share of violating bindings. In the Order Management log, 67.95% of the orders (1,359 of 2,000) are paid more than 5 days after they were placed, and thus the box turns orange.

Clicking on the number of bindings 1 shows all bindings in the Inspector, while clicking on the violation share 2 shows only the violating ones 3.
The Violation column 4 switches between violating, satisfying, and all bindings, and shows the result of each constraint for every binding.
As in the query results, clicking on an ID shows the details of that event or object.

Constraints can also involve several boxes. For example, a box connected below another box can check how many child bindings exist for each parent binding. The examples contain several such queries.