on 10-04-2013 3:40 PM
Hi
I have gone through this link on the time delay . When trying to implement it isn't working
Please advise if I am missing something .
My scenario is IDOC to IDOC where on the receiver side I would need a delay of a minute.
public String TimeDelay(String Timevar, Container container) throws StreamTransformationException{
{
try
{
Thread.sleep(60000);
}
catch(InterruptedException ie)
{}
return Timevar;
}}
This delay udf is inserted to the top root node.
FIDCCP02 ----> Delay UDF -------> FIDCCP02
But on the receiver SAP system I get the IDOCS at the same time
Thanks
Anusha
Hi Anusha,
Instead of mapping to the root node , try bringing the UDF to element level. Thus is there is a direct mapping such as
field1(source)--------->field2(target)
here you insert the UDF
public String TimeDelay(String field1, Container container) throws StreamTransformationException{
{
MappingTrace mt = container.getTrace();
mt.addInfo();
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
try
{
mt.addInfo("Current Time: "+dateFormat.format(date));
Thread.sleep(60000);
}
catch(InterruptedException ie)
{}
date = new Date();
mt.addInfo("Final Time: "+dateFormat.format(date));
return field1;
}
Now put this UDF in Mapping
field1(source)---->UDF---->field2(target).
using trace print the current time before you call Thread.sleep() method and another time after the method is called. Test this using test tab and check if this works. In the blog author mentions to map the UDF to root node but I feel this should also work.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
We have got this to work in our test area by following the instructions in the blog.
When trying it out with one or two messages, we can see the messages appearing in the Scheduled column of Message Monitor whilst the time delay is happening.
However, my concern with this is if we have many messages coming through at the same time (maybe 50+ at the same time), then won't there be an issue with the maximum number of mapping (?) threads that can be used at any one time? And, if so, wouldn't this impact the performance of SAP PI overall and could, therefore, impact other interface messages that may be processing at the same time?
So maybe there is a better way to delay the IDoc transfer where ccBPM isn't an option? I have heard we can use BPM but would that be over complicating the process?
Many Thanks,
Gareth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just try this code an let me know if works
String a;
try
{ Thread.sleep (
60000
); }
catch
(InterruptedException ie){}
return
a;
use this UDF in between the main nodes to insert the delay
please try it
also check in the SXI_MONITOR if the delay works. you should see some mapping with a delay of a minute betwwen them.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anusha,
IMO, you should apply this UDF on the IDoc node so that it induces a delay on each Idoc creation.
That should work
Hope it helps!
Ambrish
PS: I agree with Raja here that is is not a best practice.
You can also go for an alternate solution after discussion with the process team.
collect the IDocs in ECC and run a background job every 5 mins to process the IDocs.
Message was edited by: Ambrish Mishra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have you try to configure this under communication channel monitoring (top right corner) --> availability time planning.
you can avoid to create an maintain in the future the UDF
re
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why don't you try using wait method in ccBPM, using thread sleep code snippet not a best practice .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.