Skip to Content

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:

 

Problem Statement:

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.

 

Solution:

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:

Sender:

image

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:

Sender:

image

Receiver:

image

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

To report this post you need to login first.

3 Comments

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

  1. jhansi kodali
    Hi Piyush,

    Thanks for this blog..You are quite right when you say people expect to use PI as ftp service in an enterprise and I have a similar requirement.

    I need to use PI 7.0 as a FTP service to just pull  and push fields from various directories of a server to another in a scheduled way.

    Is this possible without creating any design objects or doing anything in Integration builder?
    I was wondering because even to create this communication channels and set the parameters as you have mentioned, I have to create a business service and specify the outbound and Inbound Interfaces which means I need to have the message types created for the files I am pulling and pushing.

    This essentially means I need to know the record structure or data content of each of the files that I want PI to pull.

    Please correct me if my understanding is wrong and
    guide me if you have done this before.

    Thanks very much in advance.

    Kind Regards,
    Jhansi.

    (0) 
    1. Piyush Mathur Post author
      Hi Khansi,

      There is no need for creating even a single object in Integration Repository for your requirement.
      Just maintain the systems in SLD, create the comm channel as mentioned above and then when you run the configuration wizard in ID, just enter any text in the Interface and Namespace for Sender and receiver.

      regards,
      Piyush

      (0) 

Leave a Reply