Implementation note. The engine since unified
IFandSWITCH: both are the singleIFoperation usingcases: [{when, then}]+default(SWITCHis an accepted serde alias). There is no top-levelwhen/then/elseform in the current engine or schema. The table below reflects the original design.
The v0.1.6 POC schema used values for all operations, regardless of their semantic purpose. This was inconsistent: AND/OR operations combine boolean conditions, not arbitrary values.
Additionally, the schema had action-level conditions as a special structure for if-then-else chains:
This created two problems:
values was used for both numeric operands (ADD, MULTIPLY) and boolean operands (AND, OR)conditions meant different things in operations (AND/OR operands) vs actions (if-then-else branches)Operations now use different property names based on their semantic purpose:
| Operation Type | Property | Rationale |
|---|---|---|
| Logical (AND, OR) | conditions | Combines boolean conditions |
| Numeric (ADD, SUBTRACT, MULTIPLY, DIVIDE, MIN, MAX) | values | Combines numeric values |
| Conditional (IF) | when, then, else | When condition is true, returns then; otherwise else |
| Multi-branch (SWITCH) | cases (with when/then), default | Multiple conditional branches |
Example - Logical operation:
Example - Numeric operation:
The old action-level conditions property is replaced by the SWITCH operation:
Schema structure:
Example - IF operation:
With SWITCH replacing action-level conditions, all logic flows through operations:
The conditions property has been removed from the action definition.
conditions implies boolean operands (AND/OR combine conditions)values implies numeric operands (ADD/SUBTRACT combine numbers)All conditional logic now flows through operations. No special action properties needed.
SWITCH avoids nested IF operations for if-elif-else chains, keeping YAML readable.
The word conditions now has exactly one meaning: operands for AND/OR operations.
SWITCH makes multi-branch logic explicit. The operation name describes what happens.
schema/v0.3.0/schema.jsonengine/engine.py (_evaluate_if(), _evaluate_switch(), _evaluate_when(), _evaluate_logical()) (original Python prototype, removed)packages/engine/src/operations.rs (execute_if(), execute_switch(), execute_and(), execute_or()) (Rust implementation)An exploration by Bureau Architectuur of the Dutch Ministry of the Interior into the possibilities of transparent, executable legislation.
Bureau Architectuur
Ministry of the Interior and Kingdom Relations