Rules
A rule is the fundamental unit of a policy. It defines what outcome occurs when conditions are met.
Rule Structure
Section titled “Rule Structure”[Label.] A/An/The **Selector** outcome_verb outcome_value
if condition
[and/or condition]...
.Every rule must:
- Start with an optional label followed by a period
- Have an article (
A,An, orThe) - Reference a selector
- Specify an outcome (verb + value)
- Have at least one condition after
if - End with a period (
.)
Outcome Verbs
Section titled “Outcome Verbs”The outcome verb is the action word between the selector and the outcome value. The engine supports many natural verbs:
Common Verbs
Section titled “Common Verbs”| Verb | Example |
|---|---|
gets | A **Person** gets approved |
is | A **Person** is eligible |
passes | A **Person** passes the test |
has | A **Person** has access |
receives | A **Person** receives discount |
qualifies for | A **Person** qualifies for membership |
meets | A **Person** meets requirements |
Achievement Verbs
Section titled “Achievement Verbs”achieves, attains, earns, gains, obtains, secures, acquires
Assessment Verbs
Section titled “Assessment Verbs”deserves, merits, warrants, demonstrates, shows, proves, establishes
State Verbs
Section titled “State Verbs”maintains, holds, possesses, displays, exhibits, presents
Action Verbs
Section titled “Action Verbs”provides, supplies, delivers, submits, confirms, validates, verifies
Negative Verbs
Section titled “Negative Verbs”suffers, lacks, misses, fails
Success Verbs
Section titled “Success Verbs”succeeds in, excels at, reaches, arrives at, comes to
Evaluation
Section titled “Evaluation”When the engine evaluates a rule:
- It parses the rule text
- For each condition, it reads the referenced property from the data
- It applies the operator (comparison, validation, etc.)
- It combines conditions using
and/orlogic - If all required conditions pass → result is
true - If any required condition fails → result is
false
Interactive Example
Policy Rule
Test Data (JSON)
Comments
Section titled “Comments”Use # for comments. Comments are ignored by the parser:
# Check if the student passes
A **Student** passes the exam
if __score__ of **Student** is greater than or equal to 60.