New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
one_to_many mapping - repeat source value based on count #2276
Comments
@igarashitm so I was looking into getting rid off the dropdown. The purpose of it is to point to an array to get its length and determine how many times the source value should be repeated. It's not for selecting the source value itself. If we get rid of the dropdown, we need a different way to determine how many times to repeat the source value. I was looking into reading that info from the target side, but it may not be available at the point of setting the target field. Is that right? The target array final length could be determined after processing of all other fields. I'm leaning towards keeping the dropdown and limiting listed fields to those of collection type. I would also include another parameter for specifying a count as an integer. The user would have to specify one or another. Any thoughts on how to best approach it? |
I agree.. i didn't see a way to repeat source field based on target array size, as we process source fields first and then move to processing target. so went for dropdown of source fields |
Sounds like it's a limited version of #781 where it only uses one of single collection length at source side, correct? so like |
It's a bit different. It's |
Ah OK, then it's just |
Yet another option is, at the runtime side, internally group these kind of repeating mapping depends on target array size, postpone them until other mapping finishes and then repeat for each target item that is already established by other mappings. An idea that the target array size is determined by the other mapping. It would need some core refactoring to manage mapping order. |
The reason why I don't like to introduce this field dropdown is that, it then have to provide dynamic variable for transformation parameter which is not currently suported. If we go this route, we have to design generic dynamic transformation parameter support ahead of it. I would vote to go with either Conditional Mapping and/or the postponing strategy above until we really want that generic dynamic transformation variable support apart from Conditional Mapping. |
So the proposed solution is to introduce a repeat action, which could be called from a conditional mapping as follows to achieve what you intend: repeat(/field, count(/array<>/field)) |
Sounds good, note that we already have a |
@shanthi4647, an updated fix for nested action calls are in the following commits: TODO:
|
Initial PR: #2049
from PR: "one_to_many mapping - repeat source value based on count of fieldPath and do the target transformation."
The text was updated successfully, but these errors were encountered: