gorules / zen

Open-source Business Rules Engine for your Rust, NodeJS, Python or Go applications.
https://gorules.io
MIT License
770 stars 74 forks source link

ERROR missing field "node" when creating decision #126

Closed ylaizet closed 7 months ago

ylaizet commented 7 months ago

I got the following error when I tried to create a decision from json rules files created on https://editor.gorules.io/ with python zen-engine==0.18.1

RuntimeError: Failed to serialize decision content

Caused by:
    missing field `nodes` at line 6 column 1

It's due to the order of the keys in the json rules created: if the key "nodes" is after the "edges" node, the error is raised. If I put "node" before "edges", it works.

On https://editor.gorules.io, the simulator works without problem with the same json rules files.

ylaizet commented 7 months ago

Sorry, my bad it works whatever is the order. I mixed filenames

xplore42 commented 4 months ago

@ylaizet Hi, I am also facing same issue when running it from nodeJs. could you please share how it solved for you.

ylaizet commented 4 months ago

@ylaizet Hi, I am also facing same issue when running it from nodeJs. could you please share how it solved for you.

I did not do anything special, I just realized that at some point of my numerous attempts, I mistakenly swapped the data and the rule file paths.