GoRules ZEN evaluating JSON Decision Model (JDM) graphs in-process.
A graph is the map the JDM Editor produces; a context is any map.
iex> RulezenexEngine.evaluate(graph, %{"amount" => 120})
{:ok, %{"tier" => "high"}}Set RULEZENEX_NIF_PREBUILT=1 at compile time to load a library built
elsewhere (priv/native/librulezenex.so of this application) instead of
compiling the crate.
Summary
Functions
Evaluates graph with context. Returns {:ok, result} with the output
node's value, or {:error, reason}. With trace: true the result also
holds the evaluation trace under "trace".
A traced evaluation. Returns {:ok, %{"result" => _, "trace" => _, "performance" => _}} or {:error, reason}.
Checks that graph is a well-formed decision graph.
Functions
Evaluates graph with context. Returns {:ok, result} with the output
node's value, or {:error, reason}. With trace: true the result also
holds the evaluation trace under "trace".
A traced evaluation. Returns {:ok, %{"result" => _, "trace" => _, "performance" => _}} or {:error, reason}.
Checks that graph is a well-formed decision graph.