cancel
Showing results for 
Search instead for 
Did you mean: 

preventing XI from consuming a file before it is time

Former Member
0 Kudos

Hi all,

I wish I could prevent XI from consuming a file in the outbound directory before it is time.

There are two business aspects :

<b>1</b>- a new file with the same name could be sent in the outbound directory and the old file should be erased by the new one

<b>2</b>- the message(s) extracted from the file should be sent to the receiver only during a certain period when the receiving application is ready for it.

As this problem is common to many scenarii, I am looking for some reusable solution.

I thought of (or was proposed) the following solutions :

- <b>event-driven messages</b> : the condition 2 is OK, but the file is consumed, so if a new file arrives, it is also consumed and both sets of data are sent to the receiver. Therefore, condition 1 is not correct.

- <b>BPM</b> : I am not yet familiar with this part of XI, and I wonder whether it could work.

- <b>module adapter</b> : as a Java developer, it was nearly piece of cake to say whether it was time or not to send the message(s) . But the module is executed after the file was processed, so condition 1 isn't fulfilled because the incoming file has been moved to archive directory before the authorized period. I tried to change the Processing mode from "archive" to "test" in order to avoid the file being moved and it works fine, except I'm not keen doing that in a production environment.

Moreover, when it is not time, how to cleanly" stop the process? I figured out I could sweep all data from xmlpayload so the process would carry one, but with no data. I don't know why, but it produces some mapping error and a red flag in monitoring. I also thought about throwing Exceptions, but I have no monitoring.

It's quite a long blog, but I wanted to explain what the problem was and what ways I tried.

Has anybody some advice to give me (except suicide, my boss wants his problem solved first ) ?

Regards

Yann

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

no BPM needed

create a flow that will move the file

from one folder (temp) to final (destination)

(use java proxy - just to copy from one folder to another)

this flow can be executed via abap proxy, RFC etc

(so you can schedule it with a simple ABAP report)

and the file adapter will only pick the file

once the first flow will finish

Regards,

michal

Former Member
0 Kudos

Hi Michal,

Thank you for your answer.

I tried to understand your solution but I haven't done any java proxy nor used ABAP report yet so it's not easy.

Isn't there any solution only using XI and Java (for functions, modules...)?

Regards

Yann

Message was edited by: Yann L'Hénoret

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>Isn't there any solution only using XI and Java (for functions, modules...)?

yes but a littble bit more difficult:

instead of the ABAP report you can send ANY

scheduled message to the XI (using any adapter)

and this will invoke the java proxy

that will move the file to the correct folder

so it can picked by the file adapter

at that correct time

BTW

it's that with ABAP you have nice SAP scheduler

that you can use

Regards,

michal