One Star

Howto process multiple CSV files with tFilelist and tXMLMap

Hi,
I'd like to service multiple CSV files to my clients using a RESTful Service.
Every file contains customer data and shares the same file schema.
I should be able to iterate over each file (tFileLIst) , read its data (tFileInputDelimited), and
pipe the result through a tXMLMap that will feed the tRESTResponse.
The problem I have is that only the first file in the list will be send back to the client.
1 REPLY
Seventeen Stars

Re: Howto process multiple CSV files with tFilelist and tXMLMap

I would create a job processing one file. The filename for the file to process should be given by a context variable.
After that I would create a second job which contains the tFileList component and call the first job by the iterate output of the tFileList. The tRunJob (pointing to the first job) component provide the possibility to fill the context variables of the referenced job with any values (in this case filename should be filled with ((String) globalMap.get("tFileList_1_CURRENT_FILEPATH")). You can get this globalMap expression also from the code completion facility (type tFileList and enter CTRL+Space and choose the value you need.