on 10-01-2013 10:16 AM
Hello Experts,
I have Proxy-PI-FILE scenario in which the target File Name is obtained from sending system and added to the Header DynamicConfiguration segment within Message Mapping so the receiver file adapter can takes it by using the Adapter Specific Message Attributes.
The files are being written in a PI local folder by using NFS mode and then, through an Operating System Command (script), moved to an external FTP location.
The ftp script is already in use by another interfaces, will be executed in "Run Operating System Command After Processing" section, and it expects 2 parameters: SourceFileName and TargetFileName.
As in configuration time the target file name is unknown, is it possible to use something like "<ftpScripName> %F %F" so the File gets stored in the FTP location with the same name as it was temporarily stored in PI local folder by the Comm. Channel through the Dynamic Configuration FileName value?
Thank you very much for your help.
Best Regards,
Fran
Hi
The best way is to try it out , check this doc (pg 11), where dynamic filename is given at OS command line field. here the FTP command is given/ run directly, in your case it is a script.
good luck,
Regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
%F for both source and target file will look like this (just an example) if the internal message file for PI is /tmp/filename.txt:
<script> /tmp/filename.txt /tmp/filename.txt
So the file will be written to the same location you got it from.
Therefor <script> %F %F will not work.
As i do not know the content of the script i can only guess the following.
If providing a target directory as second parameter you could just add the target directory if the target location is always the same.
But more information would be necessary to give a more proper advice.
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
nice point, as there is always a shade of doubt on what is in the script... but normally (from his above post), he talks about FTPscript, so it is expected that the servers are different and in the other (FTP) server the file is stored in a similar path as in the source with same filename..
but then Fran has to try it out and comment.
Regards
Vishnu
Thank you very much for your responses.
The FTP connection (host and login details) are also sent as parameters and included in the script code, from where the ftp connection is being made.
I was just referring to the way the the Dynamic File Name can be passed as a parameter so I should not set it statically in the command call within the channel configuration.
I will try by putting "<scriptName> %F %f", as I just want to assign the same file name (%f) but send it to a different target host (file name will include it, as the target is a based on a mainframe platform).
I will confirm once is done.
Best Regards,
Fran
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.