gorules / zen

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

Loop behaviour #273

Closed Gabrieltay closed 6 days ago

Gabrieltay commented 6 days ago

Hi guys, thanks for releasing the Passthrough and Loop features. They are awesome.

Based on the documentation, the Loop should return an array of outputs based on the array of inputs

I have a simple JDM here sample.json

using the following inputs

{
  "items": [
    {
      hello: 'foo',
    },
    {
      hello: 'koo',
    },
  ],
}

Expected response:

{
  res: [
    {
      world: 'bar',
    },
    {
      world: 'error',
    },
  ],
}

Actual response:

{
  res: [
    {
      world: 'bar',
    },
    {
      world: 'bar',
    },
  ],
}

Is this behaviour expected?

Btw, I am using the latest Standalone Editor

stefan-gorules commented 6 days ago

Hi @Gabrieltay

Thank you for the bug report. This has been confirmed and the fix will be released.

Gabrieltay commented 6 days ago

Hi @stefan-gorules , just tested with your latest patch. It works. Thanks for the quick fix 👍