Skip to Content

Business Case:We had a requirement to send multiple files located in different directories from the Business System (FTP server) to target Business System (FTP system) and create files based on the payload. 

Procedure:In order to achieve the above business case we need to process the multiple files at sender communication channel using file adapter. Sender file adapter has the option Advanced Selection for Source File. Check the option and maintain the list of directories from the source FTP server. 

 image

As per the above mentioned directories place the respective files in their folders. For Example sender folder holds the file out.xml file in the same way place the rest of the files in the sender1 and sender2 directories.           

If you want to process all files with extension ‘.xml’, and want to exclude files that begin with the letter ‘a’. To do this enter *.xml for File Name, and a* for Exclusion Mask.

 In file receiver communication channel to Create Multiple Files in the target system we are achieving this using Variable Substitution. In Advanced tab of the communication channel check the Enable under variable substitution, maintain variable name and corresponding reference of the variable. The variable can refer to an attribute of the message header or can refer to an element in the payload. However to create multiple files in the target system we are referring to the ‘Name’ element in the payload and using the prefix as payload. payload:MT_Employee,1,Employee,1,Details,1,Name,1

 image 

If we want to get the values from the Header message use prefix as message: instead of payload:. By using message:interface_namespace as a reference value to the variable.

image 

 For instance in above figure the variable ‘var1’ holds the reference of ‘Name’ element, which is use in the target filename schema for creating files in target system.

 image  

Output:

 

image

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

    1. Pavan kumar Post author
      Hi Hari,
      what i understood from your question is,if we does not maintain the actual file names, we can use *.* as file name and we can pick the files located in that particular folder and in the receiver side we are using the Variable substitution so based on the payloads in the source side i think that many files get generated……….i did not try but i think it will work

      Thanks
      Pavan kumar Nukala

      (0) 

Leave a Reply