Is there a Gel Wait command to pause the execution sequence for a number of minutes or seconds?
Something along these lines
Random function in GEL script
So if you have an on premise instance, you could just add the commons-jelly-tags-thread taglib which has a sleep tag.
Otherwise you could just put the executing thread to sleep for some amount of time.
<core:invokeStatic className='java.lang.Thread' method='sleep' var='noNeed'> <core:arg type='java.lang.Long' value='60000' /><core:invokeStatic>
Learned something new. I didn't know that the util taglib had a sleep tag!
Navdeep answer would be the correct one!
Also, as mentioned by nick_darlington - "Hopefully you only need to use util:sleep for some test case scenarios. Its usage can rapidly cause serialization (i.e. a slowdown of script execution throughput) in your system."
Happy Friday, and have a wonderful weekend
That's correct.. if this is to implement a delay prior to a retry of an operation, then try to handle that outside of the GEL script.
There are a maximum of 15 gel scripts that can execute concurrently (per process engine enabled service) and even without using util:sleep (or Thread.sleep()), congestion caused by processing delays rapidly become noticeable and even an issue; it's possible for example that all 15 threads end up sleeping at once and then all other throughput is stalled.
I would likely caution against anything more than a few seconds of sleep at most - enough to not initiate a self-inflicted denial of service perhaps - and anything using minutes should be restricted to the testing of odd edge-cases on a non-production environment only.
This begs the question, why do you need the gel script to pause?
I have run into this before, needing a gel script to wait until my external processing is completed. I have normally just restored to just having the gel script just fire and forget and the external process do all the needed logic and record updates via web services.
I have been kicking around an idea in my head to setting up an event system for some of my external processing. My thoughts are a custom object with two subobjects – one for a PPM generated event and the other for an external generated event. The master custom object could be attributed to provide the ability to define any number of event queues and the subobjects attributes with both human readable files and xml payload fields for interfacing. Using create start event and the update start events on the subobjects would provide the ability to act on a given event.
Do not (ever) use util:sleep. The sleep tag pauses the thread running the gel script. You only have ~14 threads for the running of gel scripts (per instance) so all you need is for 14 instances of your gel script to sleep to stop all gel activity on that instance. If you are waiting for an event before continuing then find some other way to trigger a process at the appropriate time.
Retrieving data ...