How to wait in the JavaScript script execution at job-level
search cancel

How to wait in the JavaScript script execution at job-level


Article ID: 131121


Updated On:


DSERIES- SERVER CA Workload Automation DE - System Agent (dSeries)


My script to recycle file triggers requires either a wait or sleep between execCommand hold and execCommand complete. In the following script the wait fails with;
"Error executing job-level runtime JavaScript script for job org.mozilla.javascript.EcmaError: ReferenceError: "wait" is not defined. (#3). The error is: {2}".

How can I wait between two execCommands in java. I don't want two links with a reldelay 1 minute in between.

//recycle file trigger;
execCommand('SUBAPPL(SUBC)','%(APPL._name).%APPL._gen','ACTION HOLD Reason("recycle file trigger")');
execCommand('SUBAPPL(SUBC)','%(APPL._name).%APPL._gen','ACTION COMPLETE Reason("recycle file trigger")');

How to wait in the JavaScript script execution at job-level.


CA Workload Automation DE (dSeries)


You can use the java.lang.Thread.sleep(xx) method in the javascript provided.

Note: Enable the “Allow Java calls in Javascript” from Admin -> Topology -> Configure Shared Parameters -> Internal -> Show Advanced Parameters, to allow JavaScript scripts to invoke Java methods.

<Please see attached file for image>

id="m_-6077858565853726990gmail-m_8888810915901957544Picture_x0020_3" height="297" src="" style="width: 8.8666in; height: 3.0916in;" width="851">

<Please see attached file for image>

id="m_-6077858565853726990gmail-m_8888810915901957544Picture_x0020_1" height="912" src="" style="width: 10.4416in; height: 9.5in;" width="1002">

<Please see attached file for image>

id="m_-6077858565853726990gmail-m_8888810915901957544Picture_x0020_2" height="688" src="" style="width: 13.825in; height: 7.1666in;" width="1327">

Additional Information

Enable Java Method Calls in JavaScript Scripts


1558687275532000131121_sktwi1f5rjvs16f8e.html get_app
1558687273812000131121_sktwi1f5rjvs16f8d.html get_app
1558687270925000131121_sktwi1f5rjvs16f8c.html get_app