Open hea-lab opened 5 years ago
Hi Jesus,
The following rule does not work properly
d.ruleset('test', function() { whenAll: m.array1.anyItem(item.array2.anyItem(item.field21 == 1) && item.field == 8) run: console.log("test", JSON.stringify(m)) });
The action code is fired with the following event which is not correct
curl -H "Content-type: application/json" -X POST -d '{"array1": [{"field" : 7, "array2" : [{"field21" : 1}]}]}' http://localhost:5000/test/events
If I slightly modify the above rule (changing the order of the conditions), the above event does not fire the action.
d.ruleset('test', function() { whenAll: m.array1.anyItem(item.field == 8 && item.array2.anyItem(item.field21 == 1)) run: console.log("test", JSON.stringify(m)) });
Hi, thanks for reporting this problem. I will take a look and reply back with my findings.
I have pushed a fix for array evaluation. The rules above now work as expected. Please use version 2.0.7.
Hi Jesus,
The following rule does not work properly
The action code is fired with the following event which is not correct
curl -H "Content-type: application/json" -X POST -d '{"array1": [{"field" : 7, "array2" : [{"field21" : 1}]}]}' http://localhost:5000/test/events
If I slightly modify the above rule (changing the order of the conditions), the above event does not fire the action.