Wednesday, March 18, 2015

How to Add time lag in IBM BPM service

While developing an application in IBM BPM, when we think of time lag first thing that comes to our mind is "Intermediate Timer Event". Yes this is correct. This work well in BPD, but how do you implement a lag during a service execution. Don't have an answer for this? Well, in this post lets look at a simple solution on how to add a time lag during a service execution.

Many of us already know that we can use some of the java classes directly in BPM server script component, here we are going to use the same technique to achieve this. Below image shows how to implement the same.



Add the below line in the server script as shown in the image to introduce a delay time between two logic executions. The method sleep() takes time in milliseconds as input.

java.lang.Thread.sleep( <<time in millseconds>>)

That is all we are good now with the desired delay in our service.

Hope this helps !!! 
 
Thanks for stopping by. If you like this post leave a comment, share it and do a g +1.



No comments:

Post a Comment