setTimeout fails with an error in PAM (Process Automation Manager)
Error:
Error: -- ReferenceError: "setTimeout" is not defined.
Release : 4.3
limitation with Rhino engine.
We use Rhino engine for Java script execution and it supports all ECMA 6 standard javascript functions.
With regard to setTimeout, there is a limitation with Rhino itself in executing this function so it must be noted that this functionality, if required, should be achieved by the user with a custom function and it can be included in the script by using include system function.
Reference:
Please refer to the list of all system functions available for usage in the Javascript section from here,
Also, more importantly, please note that our java script operator has a default execution time of 60sec which is configurable up to a maximum of 120 secs with a Configuration parameter itpam.js.exec.threshold.
The javascript operator cannot be executed for more than 120 seconds and it gets timed out if it exceeds that time. This is as per the design itself.