Environment API
The Environment
object has utility methods.
This method retrieves a system property from the environment. It can be used to pass credentials or other important details in to the script from outside of Smile CDR.
Inputs:
name
– The name of the system property. Note that the name must begin with the string js.
in order to ensure that unintended properties do not leak to the script.Outputs:
null
if none exists.Example:
If the setenv
script contains the following declaration:
JVMARGS="$JVMARGS -Djs.authkey=12345"
Or, an External File Property Source is configured with the following property:
js.authkey=12345
The following script fragment may be used to retrieve this property:
var authKey = Environment.getProperty('js.authkey');