Skip to content

Incomplete ruleResult.conditions, empty almanac in Node-Red #42

@JonSilver

Description

@JonSilver

Hi there... I tried and loved your json rules engine in node.js, so I tried installing it into the node-red environment using:

functionGlobalContext: {
        rulesEngine:require("json-rules-engine")
 }

Using a function node, I got the engine processing rules immediately... but strange things happen after the event has finished processing. Although it evaluates all the conditions accurately and fires a success or failure event, ruleResult.conditions received by the callback function is a strangely coded string (as though it's been double-stringified) and incomplete (it carries no evaluation status info, just the original conditions). Additionally, the almanac object is empty.

This is what it looks like:

conditions: "{"priority":1,"all":["{\"operator\":\"greaterThanInclusive\",\"value\":43,\"fact\":\"brian\"}","{\"operator\":\"greaterThanInclusive\",\"value\":23,\"fact\":\"sally\"}"]}"
Obviously this lack of information makes it hard to debug rules. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions