on 01-02-2007 10:29 PM
Hi All,
We have a requirement to read a specific file that has a unique name based on a transaction ID. The transaction ID will be passed from the source application.
The communication is required to be synchronous. There could be multiple requests/files generated and present at the directory at any given time but each corresponding to a specific transaction ID. If the file is not yet generated for that transaction ID we return back an error to the calling system.
I think we can not use Sender File Adapter - because of the dynamic naming and also because we have to return a synchronous response back depending on the file availability. i.e. We can not have a defined pattern in the file name nor can we specify a wild card as there could be more than one files in the location.
In theory we could use the File Sender adapter to read all the files in the directory and a BPM with correlation set based on the transaction ID and let the process wait for the request. But as far as possible I want to avoid this unnecessary wait or extra demand on the system. More so because the files could get big.
If I were using a tool like SAP Business Connector or webMethods then I would I used a readFile Java service and given it a filename to return the required bytes in a synchronous read.
Is something like this possible in XI? If someone has written a synchronous Java to read file can they share the code? Or do you suggest I write a ABAP server proxy to read the file? The problem however will be how do we map the data to a XML within the code.
All suggestions welcome. There has to be a simple and effective solution to this mundane requirement !
Wishing all SDNers a bright start to this new year,
Thanks,
Charu
Message was edited by:
Charu Kulkarni
"The transaction ID will be passed from the source application so we know what file to pick"
We used a ABAP Proxy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You could make the scenario a little simple and avoid custom development if the logic can be put into scripts(out of XI).
Say all the files are coming into a directory called D1.
Here, you could use a script to arrange all these in an order (say ascending) and move the first file into another directory D2.
The sender file adapter would poll this directory D2. The adapter can have a wild card character for the filename field now.
Once the file is in XI, you could check this against the transactionId present(I am not sure how you get this though!), and determine whether to send a mail, or to send a file back.
Here, I have assumed that there is somekind of order present in the files placed in the directory D1.
Again, this is just a suggestion.. I might be wrong with all the assumptions.
Regards,
Smitha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can also consider using sync java proxy
then you'd have to call it with the filename
(don't know how you get this transaction ID)
and inside the proxy use the filename if not successful
then raise an error if not you could just copy the file
to other folder which would take successful files (standard file adapter)
for example
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal, Archana,
Thanks for the suggestions.
I have just edited my message to make it clear that the transaction ID will be passed from the source application.
Archana - A custom Adapter I think will be a difficult thing.
Michal -Where should I look for an sample Java Proxy to read a file ? All we want to do is read the file and ofcourse move it to a archive directory.
Regards,
Charu
I guess you may have to go for custom adapter or adapter modules for doing this.
--Archana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijaya,
Thanks for the suggestion. I have just edited my message to make it clear that the transaction ID will be passed from the source application. So XI does not have to be knowledgeable about uniqueness or maintain history. Do you still think we have to use a Module Adapter?
Regards,
Charu
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.