Problem Of Plenty: Multiple File to Multiple File
Today I would address a scenario where there is a need to move multiple files (lying at different locations/folders) from one system (NFS/FTP) to another system (NFS/FTP) using PI, without any mapping.
This might seem as a vague requirement since PI would be solely doing the job of picking files from one location and dumping into another. But this is something that clients might look for when PI is acting as the backbone of the organization’s landscape.
So let’s have a look at the scenario in detail:
File_System _A has multiple folders containing files that need to be sent to target system File_System _B.
The Folder structure in the Target system should remain the same as the Source System and the target folders should be dynamically created.
Here I would like to highlight 2 features of File Adapter:
- Adapter-Specific Message Attributes (Sender and Receiver)
- Advanced Selection for Source Files (Sender)
Since we have to pick files from multiple folders from the Sender System, the File Sender Communication channel should look as below:
Note the checkbox “Advanced Selection for Source Files”
Secondly, we have to create the same folder structure and file names in the Target system. So we need to pass the “Directory Name”, “File Name” and “File Type” from the Sender to the receiver channel.
So the Sender and Receiver Comm Channel should look as below:
NOTE: One imp point to note here is that PI is capable of creating folders only up to a single level and cannot create sub folders on the fly.
After configuration the files would be picked up from the source folders and placed in the “Dynamically created” folders with the same name.
You have successfully solved the problem of plenty with a single communication channel J