Skip to main content

ZEN Engine

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 and Python. ZEN Engine allows to load and execute JSON Decision Model (JDM) from JSON files.

Visit our GitHub ZEN.

Usage

ZEN Engine is built as embeddable BRE for your Rust, NodeJS 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 Decision-as-a-Service (DaaS) over REST, take a look at GoRules Cloud.