project-flogo / core

Flogo Core is the core flogo library used create and extend Flogo applications.
BSD 3-Clause "New" or "Revised" License
109 stars 55 forks source link

Supporting index in array mapper #230

Closed lixingwang closed 3 years ago

lixingwang commented 3 years ago

Current behavior:

Today's array mapper does not have a way to let users use the looping index.

Expected behavior:

We should expose the loop index to the user which gives the ability to the user to know the current index of the loop.

What is the motivation / use case for changing the behavior?

Today there is no way to map a primitive array to an object array.

Additional information you deem important (e.g. I need this tomorrow):

lixingwang commented 3 years ago

@mellistibco @vijaynalawade In order to support this we need a keyword to access the loop index. How about below

  1. $loop.index
  2. $loop.idx

Any thoughts?

vijaynalawade commented 3 years ago

I prefer $loop.index

lixingwang commented 3 years ago

@vijaynalawade @mellistibco To be more clear. We need this keyword more unique because today we also using $loop.xxxx to access the array element. To avoid conflict with the array element we should take an as unique as possible