Skip to content

Conditions

Conditions are the checks that determine whether a rule passes or fails. They can be combined using logical operators.

Single Condition

The simplest rule has one condition:

A **Person** is adult
if __age__ of **Person** is greater than or equal to 18.

AND Conditions

Use and to require all conditions to be true:

A **Person** qualifies
if __age__ of **Person** is greater than or equal to 18
and __income__ of **Person** is greater than 50000
and __credit_score__ of **Person** is greater than 700.

All three conditions must pass for the rule to pass.

Interactive Example

Policy Rule
Test Data (JSON)

OR Conditions

Use or to require at least one condition to be true:

A **User** gets discount
if __age__ of **User** is greater than or equal to 65
or __is_student__ of **User** is equal to true
or __is_veteran__ of **User** is equal to true.

Interactive Example

Policy Rule
Test Data (JSON)

Mixed AND/OR

You can mix and and or in a single rule:

A **Person** is eligible
if __age__ of **Person** is greater than 18
and __status__ of **Person** is equal to "active"
or __role__ of **Person** is equal to "admin".

Optional Conditions: -and / -or

The -and and -or operators work as alternative condition connectors. They provide a way to express optional or bracketed conditions:

A **Person** qualifies
if __age__ of **Person** is greater than 18
-and __status__ of **Person** is equal to "active".

The -and operator functions like and but signals an optional grouping. The -or operator functions similarly for disjunctions.

Interactive Example

Policy Rule
Test Data (JSON)

See Optional Conditions for more details on -and and -or behavior.