Introduce delay (in seconds) in a process step

490 views
Skip to first unread message

somesh.m...@gmail.com

unread,
Sep 26, 2013, 7:38:32 PM9/26/13
to suppor...@runmyprocess.com, somesh.m...@ieee.org
Hi,

I have a User management custom composite API, which takes care of creating RMP user accounts, if they do not already exist (we are checking for an existing user by using the Query for RMP user connector).

This API is consumed primarily from Invitation based RMP processes. Now, there are scenarios wherein the User Management API gets invoked from a number of spawned Invitation Processes (bulk - spawned async using Jquery Ajax), which causes the remote call to Query RMP user by Email to fail with errors indicating the hit frequency to be too high. I want to introduce a brief random delay in the individual Invitation Processes using a RMP Timer, but could not figure out a way to add a formula driven "second" based delay timer as a Timer seems to be supporting a minimum of 5 minutes delay only?

Is there a way I can create a few seconds random delay period on a Process step?

Thanks!

cfo...@ltech.com

unread,
Sep 27, 2013, 12:39:08 PM9/27/13
to suppor...@runmyprocess.com, somesh.m...@ieee.org, somesh.m...@gmail.com
Somesh,
The timer can't be set to less than 5 minutes, however, we can most likely implement the desired solution using a custom delay (see the example script below).

We will want to use this script as either an input or output variable in one of the steps in the process. Also, please note that this is javascript and we don't want to mix Freemarker with it.

<@script env="javascript">
/* wait 500ms */
var start = Date.now() ;
var right_t = start;
while((right_t-start) < 500) {
right_t = Date.now();
}
print(right_t-start);
</@script>

====

Thanks,
Craig

somesh.m...@gmail.com

unread,
Sep 27, 2013, 3:20:55 PM9/27/13
to suppor...@runmyprocess.com, somesh.m...@ieee.org, somesh.m...@gmail.com, cfo...@ltech.com
Thanks Craig. My intention was to find a Non JS based solution, which I can use at the Process level.

Now that you have responded to the question, it helps me to explain: I have a need to add the delay when I spawn the reference request processes on submission of a nomination. Points to note:

* Nomination submission client side code is already doing a ton of other work and needs to be optimized. I was not willing to put a JS level delay but let's discuss if there are no feasible alternatives

* The delay cannot be significant (5min +) because the subsequent view on the landing page is rendered out of the spawned process web interface report

cfo...@ltech.com

unread,
Sep 27, 2013, 3:50:50 PM9/27/13
to suppor...@runmyprocess.com, somesh.m...@ieee.org, somesh.m...@gmail.com
Sure Somesh, understood. The sample script should work at the process level. We will have to use this script (or a similar script) as an input or output variable for a given step of the process. If this still does not meet your requirements, we can jump on a call to discuss further.

On Thursday, September 26, 2013 4:38:32 PM UTC-7, somesh.m...@gmail.com wrote:

Reply all
Reply to author
Forward
0 new messages