roboto.domain.triggers.conditions#

Module Contents#

class roboto.domain.triggers.conditions.ConditionMatcher(namespace, default_root)#

Evaluates a trigger condition tree against an event namespace.

Reuses the query Condition comparators unchanged; only the value source differs. Each leaf routes to the namespace root its field targets and matches against that root’s record, so roots hydrate lazily on first reference. A root whose record is missing evaluates to a non-match, so NOT_EXISTS and IS_NULL never match against an entity that was deleted before evaluation.

Parameters:
matches(condition)#

Return whether condition holds for the event. A None condition always matches.

Parameters:

condition (Optional[roboto.query.ConditionType])

Return type:

bool

roboto.domain.triggers.conditions.UNSTRIPPED_ROOTS: frozenset[str]#

Namespace roots the query Field parser does not recognize as resource prefixes, so it leaves them in the lookup path (changed.vehicle_id stays whole, unlike dataset.x which strips to x). Derived from the default catalog’s exposed roots.

roboto.domain.triggers.conditions.explicit_root(condition)#

Return the namespace root condition’s field explicitly names, or None if unqualified.

dataset.*/file.*/topic.*/msgpath.* prefixes are recognized by the query field parser; any other first segment counts as a root only when it is in UNSTRIPPED_ROOTS. An unqualified field binds to the event’s default root.

Parameters:

condition (roboto.query.Condition)

Return type:

Optional[str]

roboto.domain.triggers.conditions.iter_leaf_conditions(condition)#

Yield every leaf Condition in condition, depth-first.

Parameters:

condition (roboto.query.ConditionType)

Return type:

collections.abc.Iterator[roboto.query.Condition]