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")');
wait(120000);
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.