cancel
Showing results for 
Search instead for 
Did you mean: 

Time Difference between file processing

0 Kudos

Dear All

We have a requirement where we have give a gap of 8-10 minutes between each file processing.

We will get around 10 files at a time, need to pic one file then wait for 10 minutes then pick up the next

Sourabh

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Sourabh,

Based on your requirement i understand that you need to send the data to the target system with a gap of 10 min, even though multiple files have been picked up at sender side for each poll.

This can be done by using script in the channel.

Below is the approach how we can achieve this without scripts or BPM.

Note: This approach will work only if you are having mapping in your scenario.

1. Configure the sender channel with QOS as EOIO and specify a queue name for the same.

2. Create a UDF with the below code and map the output of the UDF to the target root node. In your case specify the value for sleep method as 600000. This will ensure that for every invoke of the message mapping, it will wait for 10 min to execute the target mapping.

Regards,

Veerendra.

ambrish_mishra
Active Contributor
0 Kudos

Hi Sourabh,

I am not sure if ATP will work in this scenario. However, I suggest you create 2 folders, one temporary folder where the files are dumped. create a script which moved the latest file to the main folder, then waits for 10 mins and then sniffs the folder again to see if file(s) exists, if yes, then again moves the latest file to the other folder....

This second folder is configured in sender file adapter. This way you can achieve the delay.

Hope it helps!

Ambrish

PS: I have seen scripts like these working without issues.

peter_wallner2
Active Contributor
0 Kudos

Hello,

if your PI runs on AIX, you could just use "Run Operating System Command After Message Processing" and type in "sleep 20" (the value you give are the seconds the adapter waits) - so in your case it should be "sleep 600".

If your PI runs on Windows have a look here: http://scn.sap.com/thread/2037561 the equivalant command would be "choice".

Best regards,

Peter

Bhargavakrishna
Active Contributor
0 Kudos

Hi Sourabh,

May i know which version of PI you are using? if it is 7.1 SP9 and above, i think you can achieve this by specifying the below parameter in the communication channel.

can you try this and let me know the result.

just specify the MSecs as per your requirement. with this you can achieve the time difference between processing of messages.

Regards

Bhargava krishna

Former Member
0 Kudos

File adapter will pick all the files when the polled. So, I think you can write a UDF to make communication channel sleep for the some time using the below UDF

{ try

   {           Thread.sleep (600);

    }

catch (InterruptedException ie){}

return a;

}

Thanks,

naveen_chichili
Active Contributor
0 Kudos

Hi Sourabh,

You can achieve this by using BPM.

Thanks and Regards,

Naveen