on 04-12-2007 1:09 PM
Hi
For a file adapter I had enabled the option <b>Archieve File</b> in my communication channel. So the system will put the file in the archieve folder after it is read. My requirement is to check if the file already exits in the archieve folder or not. Any means of checking it? or shud i make use of adapter modules? If yes kindly point some helpful tips on the same.
Kindly fwd any useful doc to mailprabhu@gmail.com
regds
prabhu
Prabhu,
a Simpler solution.
Use BPM.
1. A Receive Step in the BPM will get the file from Source Folder.
2. Anther Receive Step in the BPM will (try) to get the file from the Archive folder.
3. Wrap step 2 inside a deadline monitopring block.
If deadline is reached, file is not in archive folder. And so you can do as you want else write the logic in the next steps if the file exists in the archive folder.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i had set the option <b>Archieve file</b> in my comm channel. so when the file is processed it is archeived. before the system archeives the file i need to check if the file is present i.e. already archeived in that folder. if it is seen then i need to place the file in another folder instead of the archeived folder.
Prabhu,
When the file adapter is going to archive this file, it will overwrite the file if the file already exists in the archive folder and so I dont think Archive mode will handle this.
Soltuion would be to keep the mode as Test and then write a Script that you execute from the file adapter ( command processing ) and this script will check if th file exists in the archive folder. If no, moves it to archive folder , if yes, then moves it to the other foloder.
Regards
Bhavesh
> 1. shud the script be present in the XI server?
Yes. The script should exists on XI server.
> 2. say my file "/data/usr/test/test.txt" is FTP
> location is 10.252.78.09 and can i have the script
> located in the same location? if yes will the script
> be executed?
No. the script will have to reaside on XI server connect to the FTP server read the file and move it as you want.
OS commands are executed on the same server itself. I dont think they can be exectued on other machines.
Regards
Bhavesh
Prabhu,
The os command in the file adapter should exists in the XI server only.
Whatever command you provide in the Adapter will result in the SID+"ADM" user id exectuing this command at the oS level of your XI server.
So this script should exist on the XI server.
Now, if the archive directory is on the FTP server you will have to connect to the FTP server from the script and check if the file exists and then do the needful.
Check this blog out for executing Scripts on file adapters,
/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
Regards
Bhavesh
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.