cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter Module - Help

prabhu_s2
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

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

prabhu_s2
Active Contributor
0 Kudos

thks for the quick point. will try that out and can we make use of adapter modules? any good docs on that?

prabhu_s2
Active Contributor
0 Kudos

to be much clear on my requirement once the file is read, it is moved to the archeived folder. if in case the file is already in archeive folder i need to have this file moved to another folder. how to goahead with this?

bhavesh_kantilal
Active Contributor
0 Kudos

Prabhu,

Sorry, but I am now lost in the requirement

The best document on Modules is the How to Guide for Adapter Mopdules.

Regards

bhavesh

prabhu_s2
Active Contributor
0 Kudos

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.

bhavesh_kantilal
Active Contributor
0 Kudos

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

prabhu_s2
Active Contributor
0 Kudos

okie sounds to be achievable ....let me try this option out and keep the forum posted the same....i think the first option provided might throw some issues as when correlation comes into picture

prabhu_s2
Active Contributor
0 Kudos

i need some clarification on using script....

1. shud the script be present in the 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?

bhavesh_kantilal
Active Contributor
0 Kudos

> 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_s2
Active Contributor
0 Kudos

so does it mean that the file shud also exist in the xi server?....can u provide a broader view on it?

bhavesh_kantilal
Active Contributor
0 Kudos

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

bhavesh_kantilal
Active Contributor
0 Kudos

The user id is SID+"ADM" only for Unix Based XI installations.

For windows based the user id is , "SAPService"+SID.

Regards

Bhavesh

prabhu_s2
Active Contributor
0 Kudos

okie thkx...i'll close this thread and open a new one if i find issues in implementing it

Answers (0)