Configuring the VTA to Run Scripts
The script runner processor can invoke external executable scripts or JavaScript programs. We recommend using JavaScript for better performance.
- External scripts are executable programs, such as shell scripts, that are available on the VTA's host. Each external script can perform a task and return a value. If the script returns a value, the value can be added to the current event as an event attribute.
- JavaScript programs are used to process attributes of a VTA event. For example, it can convert a VTA event attribute in a timestamp to a date string and add it to the event as a new attribute. The attribute can then be used for subsequent actions, such as sending an e-mail notification to the subscriber. The JavaScript program can refer to any attributes of the event being processed, and it must return a value.
To configure the script runner processor:
Configuring JavaScript Programs
To configure a JavaScript program:
The Current Configuration window appears.
The Script Runner Processor configuration appears.
![]()
- If the script runner processor is disabled, click Enable to enable it.
- Enter the name of the script in the New Javascript box, and click Create.
The JavaScript configuration appears.
![]()
See JavaScript Fields.
See Configuring VTA Actions to Run Scripts.
JavaScript Fields
This section describes the fields used to configure JavaScript programs.
New Javascript
Javascript
- A function body in JavaScript.
- Value—Path name. To refer to the event attributes being processed, include the attribute name delimited by angle brackets (<and>). The JavaScript can verify whether the event has the referred attribute. If a referred attribute does not exist in the event, the attribute's value is null. The JavaScript must return a value.
- Default—No value
Parameter
- Parameters required by the script. When invoking the script from an action, the action must supply values for these parameters.
- Value—Comma-separated list of parameters
- Default—No value
- Example—fullLoginName
Return Attribute
- Attribute that provides the return value of the script as a valid Java identifier that subsequent actions and event handlers can refer to.
- Value—Attribute name
- Guidelines—JavaScripts 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.
- Default—No value
Return Type
Configuring External Scripts
To configure an external script:
The Current Configuration window appears.
The Script Runner Processor configuration appears.
![]()
- If the Script Runner processor is disabled, click Enable to enable it.
- Enter the name of the script in the New External Script box, and click Create.
The External Script configuration appears.
![]()
See Configuring VTA Actions to Run Scripts.
External Script Fields
This section describes the fields used to configure external scripts.
New External Script
Full Path
Parameter
- Parameters required by the script. When an action invokes the script, the action must supply values for these parameters.
- Value—Comma-separated list of parameters
- Guidelines—External scripts require parameters.
- Default—No value
- Example—fullLoginName
Return Attribute
- 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 used by the event. The external script returns the value by printing to standard output.
- Value—Attribute
- Guidelines—The name of a return attribute cannot start with an underscore (_), because these event attributes are reserved for internal use.
- Default—No value
Return Type
Configuring VTA Actions to Run Scripts
You can configure actions that the script runner processor performs on events. For example, you can set up an action to run either an external script or a JavaScript program.
To configure actions for the script runner processor:
- In the VTA Configuration Manager navigation pane, select Edit.
- Under Current Configuration, click Actions.
A list of actions appears. For example:
![]()
The action configuration screen appears.
![]()
- Select ScriptRunner in the Processor field, and click Save. (If ScriptRunner does not appear in the drop-down list, enable the script runner processor.)
An expanded configuration screen for the action appears.
![]()
Processor
- Processor for which you are configuring the action.
- Value—ScriptRunner (If ScriptRunner does not appear in the drop-down list, enable the script runner processor.)
- Default—No value
Function
- ExecExtScript—Runs an external script defined in the processor. It provides any defined ReturnAttribute attribute for the corresponding script as output by adding the attribute to the event.
- ExecJavaScript—Runs a JavaScript defined in the processor. It provides any defined ReturnAttribute attribute for the corresponding script as output by adding the attribute to the event.
Parameter Name
Parameter Content
- For scriptName parameters—Name of the script
- For other parameters—Values of parameters that you declared in the script
Abort On Error