Closed bjorntheart closed 1 month ago
Turns out you can't have a spaces in the folder name otherwise under the hood the decision loader fails. I'd suggest that there be some validation on naming rules for decision documents and folder naming.
Feel free to close.
Also, running await zend.evaluate()
in
.map(async function(o) {
// params left out for brevity
await zen.evaluate(...)
})
doesn't work.
What works is running it inside a regular for loop like so:
for (const [k, bike] of Object.entries(bikes)) {
let result = await zen.evaluate('ererer/insurables/bike.json', bike, { trace: true });
console.log({ result });
}
Hi Bjorn, we will take a look at it why it isn't working in map. Can you try:
await Promise.all(somelist.map(async () => { return await zen.evaluate(); }));
Works like a charm, thanks @ivanmiletic. Right after you commented I remembered I had some code lying around doing just that.
let evaluated = await Promise.all(
bikes.map(async function (insurable) {
let r = await decision.evaluate(insurable, { trace: false });
return { ...r.result, insurable };
}),
);
Closing as the thread has been resolved.
I'm on a free trial of cloud on gorules.io
I have a function that calls
zen.evaluate()
on another decision that is published and get the following error