Ability to add List of Flows to Flowbuilder's add function #4630
Replies: 2 comments
-
What about preparing the builder then calling |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok currently I have gone for an alternative work around solution but I will surely try this one too.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was working on a spring batch where I have
n
number of vendors. Vendors are mentioned in the configuration file as a list. Number of vendors can change. For every vendor I needed to do the same steps with some parameter changes like the sql query for the item reader and all other wise everything is same. So, I thought of doing the operation for every vendor in parallel usingSimpleAsycTaskExecutor
asTaskExecutor
. I was doing something like this:Here flow1, flow2, flow3 are flows that contain same steps with some vendor specific changes. What I want is to define a dynamic number of flows as a list of Flow objects. and pass the list to the add function. In this way I don't have to define a separate flow every time a vendor is added or removed. I would just iterate through the vendor list and create a Flow object for each of them.
The current implementation of the add function is like this:
You see in the function it is being treated as a list only so why not let me pass the arguments as
List<Flow>
only. We can create an additional implementation ofadd()
function that acceptsList<Flow>
type argument. This will help create job with dynamic number of parallel Flows and I don't have to do any code level change every time some change occur in vendor list.If the add function's implementation would be like this:
I can in my code do like this:
I may be entirely off in my approach so, I need suggestions that is why I'm opening this in discussion not in issues. I need suggestions regarding how do I approach this problem.
Beta Was this translation helpful? Give feedback.
All reactions