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:
- Starts from the current row
- Follows one or more relations
- Collects the related rows
- 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:
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.
-
Start with a row
The system begins with the row being evaluated. -
Follow relations
The system moves through the data model using defined relations. -
Collect related rows
All rows found at the end of the relation path are collected. -
Apply filters (optional)
The system may remove rows that do not match additional conditions. -
Count the result
The number of remaining rows is compared with a rule.
If the rule is satisfied, the classification becomes true.
Example rule:
Example
Imagine the following structure:
Tables
- Customer
- Contract
Relation
Classification:
Rule:
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:
Filter:
Rule:
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
→ Core
Related resources
Reference
How-to
Related concepts