Skip to content

Relational classifications

Relational classifications check data in related tables to decide whether a condition is true or false.

They are used when a rule depends on information that is not stored in the current row, but somewhere else in the data model.

Examples:

  • A booking is valid only if it has an assigned room.
  • A customer is active only if they have at least one valid contract.
  • A project is complete only if all tasks are finished.
  • A room is available only if there are no overlapping bookings.

In these situations the system must follow relations between tables to evaluate the condition.

What a relational classification is

A relational classification is a named condition that follows relations to other tables.

Instead of checking a single column, the system:

  1. Starts from the current row
  2. Follows one or more relations
  3. Collects the related rows
  4. Checks whether the result satisfies a condition

The result is always true or false.

Example:

Table: Customer

Condition:

A customer is active if they have at least one contract.

Relation path:

Customer → Contract

Evaluation:

Customer Contracts found Active customer
Anna 2 true
Erik 0 false

The classification does not change the data.
It simply evaluates the relationship between rows.

How relational classifications work

Relational classifications follow a simple process.

  1. Start with a row
    The system begins with the row being evaluated.

  2. Follow relations
    The system moves through the data model using defined relations.

  3. Collect related rows
    All rows found at the end of the relation path are collected.

  4. Apply filters (optional)
    The system may remove rows that do not match additional conditions.

  5. Count the result
    The number of remaining rows is compared with a rule.

If the rule is satisfied, the classification becomes true.

Example rule:

number_of_related_rows > 0

Example

Imagine the following structure:

Tables

  • Customer
  • Contract

Relation

Customer → Contract

Classification:

Customer has contract

Rule:

count(contracts) > 0

Result:

Customer Contracts Has contract
Anna 1 true
Erik 0 false

This classification can now be reused by rules, filters, or permissions.

Filters

Sometimes not all related rows should be counted.

Filters allow the classification to consider only certain rows.

Example:

A customer is considered active only if they have a valid contract.

Relation path:

Customer → Contract

Filter:

contract_status = "valid"

Rule:

count(valid contracts) > 0

Filters allow relational classifications to express real business rules more precisely.

A simple way to think about relational classifications

A relational classification answers a question like:

Does this row have related rows that satisfy a certain condition?

By following relations between tables, the system can evaluate rules that depend on the wider data model instead of just one row.

Where to go from here

Relational classifications

Core

Filters overview

Classification filters

Set filters

Temporal filters