cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple files to genrate with dynamic file name

Former Member
0 Kudos

For each item from the source message (idoc with Header and Item segments) without BPM, I should generate one file for each item. While generating the files, the name of the file should be dynamic.

I am able to configure the scenario properly, but the File Adapter is always creating a file for the last item, the name of the file should be generated from the item field value.

Example: Message has 1 header segment and 3 item segments, as per the design , I should have three files but I see only one file for the 3rd item.

Observation: when I change the File Construction Mode: Add Timestamp, I am able to see three files,

FIY, I have configured the scenario correctly and working fine, so please donu2019t send me the link for configuring the scenario,

Can someone throw light, please?

Regards

Deepika

Accepted Solutions (0)

Answers (1)

Answers (1)

aashish_sinha
Active Contributor
0 Kudos

Hi Deepika,

In my understanding, everything else is fine. When you add timestamp, it treats the file as unique one. So, at target directory it is writing unique file (TimeStamp Case). Now when you remove it, you find it only one file because file is getting overwritten. So, here the catch is, in the java code you using or written, just add some looping thing and then try to append that loop value with file name to generate a new and unique file. Lets say if file name is file then just append the loop no to filename and it will became file0, file1,and file2.

Regards

Aashish Sinha