mirror of
https://github.com/gorules/zen.git
synced 2026-11-30 00:07:34 +00:00
Validate date columns, dictionary properties and nested lists by column, delegate a refused block for its own rows instead of sharing every row, keep blocks whose lazy reads have no writers in one step, run declared date inputs and strict tables with empty output cells typed, and resolve references to a pool by columns. Rows whose delegated block fails are re-run on the row engine, and a resolved reference stays missing where its key is missing. Rows are shared again by a static rule when most member blocks would be delegated.
ZEN Expression Language
The expression language of ZEN Engine, the open-source Business Rules Engine (BRE) from GoRules.
ZEN expressions are readable by business users and fast enough for hot paths: a complete language for conditions, calculations and data transformation, with lexer, parser, compiler, VM, type checking and editor completions included in this crate.
use serde_json::json;
use zen_expression::evaluate_expression;
fn main() {
let result = evaluate_expression(
"sum(items) * multiplier",
json!({ "items": [10, 20, 30], "multiplier": 2 }).into(),
)
.unwrap();
// => 120
}
Reusable expressions compile once via compile_expression and evaluate repeatedly against different contexts.
Resources
- ZEN Expression Language reference - syntax, operators, built-in functions and date operations
- ZEN Engine - the rules engine built on this language
- GoRules - the platform around the open-source engine
- Online Editor - try expressions in the free editor with a built-in simulator