Skip to main content

Overview

Open-source Business Rules Engine

ZEN Engine is business friendly Open-Source Business Rules Engine (BRE) to execute decision models according to the GoRules JSON Decision Model (JDM) standard. It is written in Rust and provides native bindings for NodeJS, Go and Python. ZEN Engine allows to load and execute JSON Decision Model (JDM) from JSON files.

Visit our GitHub ZEN Engine.

Usage

ZEN Engine is built as embeddable BRE for your Rust, NodeJS, Go or Python applications.

Installation

[dependencies]
zen-engine = "0"

Evaluating Decision - Simple Usage

ZENEngine parses JDM from JSON content. It is up to you to obtain the JSON content, e.g. from file system, database or service call.

use serde_json::json;
use zen_engine::DecisionEngine;
use zen_engine::model::DecisionContent;

async fn evaluate() {
let decision_content: DecisionContent = serde_json::from_str(include_str!("jdm_graph.json")).unwrap();
let engine = DecisionEngine::default();
let decision = engine.create_decision(decision_content.into());

let result = decision.evaluate(&json!({ "input": 12 })).await;
}

If you are looking for a Business Rules Management System (BRMS) over REST, take a look at GoRules BRMS.

Support matrix

ArchRustNodeJSGoPython
linux-x64-gnu✔️✔️✔️✔️
linux-arm64-gnu✔️✔️✔️✔️
darwin-x64✔️✔️✔️✔️
darwin-arm64✔️✔️✔️✔️
win32-x64-msvc✔️✔️✔️✔️
caution

We do not support linux-musl for now as we are relying on the GoogleV8 engine that has no support for linux-musl to run function blocks as isolates.