Skip to main content

Posts

Showing posts from 2018

Simple timer implementation in IBM BPM service

In IBM BPM we can use the Timer events in the BPDs to introduce the waiting period but we don't have any direct implementation of the timer in the service flows (or the server-side scripts). In this post, I'll explain a simple way to use the existing Java class in the script to simulate the time delays in the server-side logic. Below image shows the implementation of it. In the above example, I have used the java.lang.Thread.sleep() method to add the desired delay. The best part of this implementation is we don't need to import any additional package or classes the time is accurate to the milliseconds and not random and different when we try to use the counter and for/while loop Below is the script for reference var waitTime = function(milliseconds) { log.info("Wait time for " milliseconds" + milliseconds start"); java.lang.Thread.sleep(milliseconds); log.info("wait time over"); } waitTime(2000); That's all i...