cancel
Showing results for 
Search instead for 
Did you mean: 

FTP Adapter with Runtime OS Command before Message Processing

Former Member
0 Kudos
94

Hi PI Techies,

I have a confusion in using Sender FTP Adapter with Runtime OS Command before Message Processing.

Scenario is like this:

Ftp Adapter has to pick a file from FTP server after it checks that a Blank Marker file exists on PI server AL11 directory say "tmp directory".

For this I am using Runtime OS Command before Message Processing where a shell script will check the existence of Blank Marker file on PI server AL11 and if found , it exits the script and FTP Adpater will then pick the Actual Data File and Process it.

Now Confusion:

I am confused in technical execution of steps by FTP Adapter..

Whether FTP Adapter polling initiates the Interface or Runtime OS command checking the File existence will initiate the Interface?

May be its follish to you guys... but please answer ..

Regards,

Anurag

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Exactly, only if File declared in FileAdapter exist, it instantiate the Scenario Execution.

You can set in Adapter the Marker Filename:

- When Marker File exist in PollDirectory, it execute the OS command to trasfer file to destination. Otherwise, the ShellScript can move the file to an "Output Queue" directory, and then send it with another FTP CommChannell (in polling to this "Output Queue" directory

Former Member
0 Kudos

Hi,

I will take it other way as we need to process the Data File not Marker File ( its just for checking the Data File is completely written on FTP server).

Other way mean " Will Poll for Data.txt File and if found then Runtime OS Command will do connect to FTP and check if Marker File exists, if yes then delete the marker file and read the actual Data File for processing.

Please let me know, if Marker File does not exists on FTP folder, will it still read the Data File or will it exit the Adapter execution?

Your help is much appreciated.

Regards,

Anurag

Former Member
0 Kudos

In your way, after Shell execution, It still execute the scenario.

In my way written above, you use the MarkerFile to Start the 1° Channel (and then, run the script), and move the DATAFILE (with the OS Script) to another "Output" directory. Subsequently, with 1° Channel you delete the file without send to a receiver directory. You can do this also putting the Shell Script in Crontab (like a scheduling).

With a 2° FTP Channel, you poll the output directory and send the file.

Another way, more complicated, is to develope a custom Java code, to do this.

Former Member
0 Kudos

Hi,

Thanks for answer..

How is the Error Handling being done to track if something goes wrong with Script in FTP Connection?

Is there any way to track this in PI?

Is there any way to create a Log File for Shell Script to see the details of File Transfer?

Regards,

Anurag

Former Member
0 Kudos

Shell Log Error is putted in RWB monitoring. With "ECHO" command, you can put custom error log text visible by RWB Monitoring.