Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Configuring JavaScript Programs


Use the following statement to configure a JavaScript program for the SRC VTA:

  1. From configuration mode, access the statement that configures a JavaScript script and specify the name of the JavaScript program. For example, to configure a JavaScript script called js1:

  2. Specify a function body in JavaScript.

    To refer to the event attributes being processed, include the attribute name delimited by angle brackets (<and>). The JavaScript program can verify whether the event has the referenced attribute. If a referenced attribute does not exist in the event, the attribute’s value is null. The JavaScript program must return a value.

  3. (Optional) Specify the Java type of the return attribute.

    Where the return-type is one of the following:

    • Integer

    • Long

    • Float

    • Double

    • String

    • Boolean

  4. (Optional) Specify the name of the return attribute.

    Specify an attribute that provides the return value of the script as a valid Java identifier that subsequent actions and event handlers can refer to. If this attribute is not set, the return value is not added to the event as an event attribute.

    JavaScript scripts must return an attribute value. The name of a return attribute cannot start with an underscore (_) because these event attributes are reserved for internal use.