One Star

How to group list of row into java list object an inverse ?

Hi
I'm using Talend to manage flow that call Java api. I use TjavaFlex and write java routine to wrap the java api all is fine.
My problem I've an api that receive a List<String> as parameter and return back a String array.
like String[] call(List<String> data)
In my flow I get the data from 1 column and I need to build a bulk of 5000 string put this into a list an call the API, the API return back String[] this string array need to continue the flow. Of course I need to make this for each 5000 rows.
I've tried to play with Tbuffer but I don't understand how to change 5000 row to a list
I don't know also how to reenter into the flow the string array that I get back from the API
Please help
6 REPLIES
One Star

Re: How to group list of row into java list object an inverse ?

Hello Nobody have an idea ??
Is there anybody have ever use a list type field ??
Thanks
Employee

Re: How to group list of row into java list object an inverse ?

I hope I understood your request and I built this job, see the screenshots.
One Star

Re: How to group list of row into java list object an inverse ?

Thanks for your response it's ok for the second part of the problem meaning To get an array back from the API and loop on it
many thanks for this.
But the first part is more complicated :
I need to build a List java object with data from Tmap meaning that Tmap need to output the data to TjavaFlex but it going to make it for each row I need to take these rows data and add them into a list WHEN the list size = 5000 I need to call my java API and pass this list as parameter
If you need more detailled description tell me what could help you
Thanks
Employee

Re: How to group list of row into java list object an inverse ?

I think the new job should response to your need.
One Star

Re: How to group list of row into java list object an inverse ?

I got It !!!!
Thank you very much
One Star

Re: How to group list of row into java list object an inverse ?

I hope I understood your request and I built this job, see the screenshots.

can you explain me how do you do that...please...
because i get lost... in the part where you getGloba...
tks...