The Evaluation Flow
When you callevaluateExpr(), four things happen:
Let’s trace through this example:
Step 1: Parse the Rule
Engine reads the rule and finds the operator. The first key of the object is always the operator name.Step 2: Resolve Paths
For each argument, engine extracts values from your data.Step 3: Execute Operator
With resolved values, operator runs its logic.Step 4: Return Result
Engine returns a result object:Caching
Engine caches results for speed. Same rule + same data = instant return.Stateful Evaluation
StatefulRuleEngine adds state tracking on top:
Error Recovery Flow
When errors happen, recovery kicks in:| Recovery | What it does |
|---|---|
| Circuit Breaker | Stops calling failing rules |
| Retry | Tries again with backoff |
| Fallback | Returns safe default |
