cancel
Showing results for 
Search instead for 
Did you mean: 

How to merge/append two files in sequence using BPM

Former Member
0 Kudos

Hi All,

My senario is to append two files data into a new file on target system, only if the two files are available on source system. In case one file on the source system, no need to process file. Data in the new file should be in sequence means 1st file data then 2nd file data.

Please suggest me how can i achieve this functionality using BPM.

Thanks & Regards

Sreeni

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos

For the first part (two files required) design as per Prateek's suggestion

Data in the new file should be in sequence means 1st file data then 2nd file data.

create a data structure which will be a combined structure of File1 and File2....target structure should have first reference for File1 and then for FIle2....than having two MTs (File1 and File2) at the source and the target MT at the receiver create your mapping......this will ensure that File1 data occures first and then File2 data.

Regards,

Abhishek.

prateek
Active Contributor
0 Kudos

Put the receive steps in BPM in fork and set its property with Necessary branches = 2. This will ensure that it will wait for both the files before proceeding further. Then put a transform step to perform 2:1 mapping. You may put fork inside deadline branch if you would like to raise an exception in case the two files are not received in some particular time interval.

Regards,

Prateek

Former Member
0 Kudos

Thank you Prateek. Still i need inputs on checking the files availabilitity.

In case of one file, Interface has to wait a minute for second file. If the second file is available with in a minute, then only interface has to merge two files data.

If Second file is not available in a minute, then interface has to stop the further processing and delete the first file from the source system.

Could you please suggest on How to get this functionality.

Thanks & Regards

Sreeni

Satyagadadas
Active Participant
0 Kudos

put a script on XI BOX and excute it before message processing.

Script should look for 2 files and if they are available chang those file names.

Using XI, you should read those new files only with above suggested plan.

prateek
Active Contributor
0 Kudos

Use the same config as I suggested above. The timeout would be 1 minute in this case. As soon as the first file is picked, a new BPM instance is started. So there is no problem about deletion of the file.

Regards,

Prateek