setTimeout Javascript functions does not work in PAM
search cancel

setTimeout Javascript functions does not work in PAM

book

Article ID: 275260

calendar_today

Updated On:

Products

CA Process Automation Base

Issue/Introduction

setTimeout fails with an error in PAM (Process Automation Manager)

Error:

Error: -- ReferenceError: "setTimeout" is not defined.

 

Environment

Release : 4.3

Cause

limitation with Rhino engine.

Resolution

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:

include Function

Please refer to the list of all system functions available for usage in the Javascript section from here, 

System Functions

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.