How To Define Local Script Variables in the Cisco Unified CCX Editor

This section describes how to define a local script variable, a variable created in a script and specific only to that script.

Note

In addition to defining local script variables, you can also define expanded call variables for use with the Enterprise Call Info steps.

To define a new local script variable, click the New Variable icon at the top left corner of the Variable pane of the Cisco Unified CCX Editor window.

The New Variable dialog box appears.

New Variable Dialog Box

After you use the New Variable dialog box to define your variables, the variables appear in the Cisco Unified CCX Script Editor Variable pane.

You can select a listed variable and use the Modify or Delete icons in the toolbar of the Variable pane to make any necessary changes.

The table below describes the fields in the New and Edit Variable dialog boxes.

New and Edit Variable Properties

Property

Description

Type

(Drop-down list.) Type of variable you want to declare. This is either a friendly data type or a fully qualified Java class name (for example, java.util.ArrayList).

Note

For a list of available Cisco Unified CCX variable types, seeTable -- Available Cisco Unified CCX Variable Types

Name

Name of the variable you want to declare.

Value

(Expression.) Data you initially assign to a variable. The type of data you enter must match the data type you declared in the Type field.

Data can consist of valid expressions of the same type and can include final variables (if the variable for which the value is defined is not marked final).

The Cisco Unified CCX Editor evaluates initial values for variables before the first step in the script is executed. For example, an expression such as new Date() would be evaluated at the time the script executes and results in a data object representing the current date.

Note

The same expression can be written as D[now] for simplicity.

Final

(Checkbox.) If enabled, marks the variable as one that cannot have its value changed. Such a variable is known as a constant and can be used to define other non-final variable initial values.

The keyword final can also be prefixed to the data type for the same result, to make a variable final of type integer, as in the following example:

final int

Parameter

(Checkbox.) If enabled, sets the value for this parameter in the Cisco Unified CCX Administration web interface when you provision applications that use this script.

Array

(Checkbox.) If enabled, defines the variable as an array (seen by, or entered by, the ending [] on the variable type).

Dimensions

(Checkbox.) If enabled, allows you to use the drop-down list to define the dimensions of an array variable:

  • If set at 0, then the variable is not defined as an array.

  • If set to 1, it defines the variable as an array of dimension 1; if set to 2, an array of dimension 2, and so on.

Note

You can also simply type ending brackets ([]) to the variable type to indicate to the Cisco Unified CCX Editor that an array is being created.