Introducing the Cisco CRA Editor

Table of Contents

Introducing the Cisco CRA Editor
Overview
CRA Editor Installation
The CRA Editor Window
The Palette Pane
The Design Pane
The Variable Pane
Expressions
The Debug Pane
Basic Error Handling

Introducing the Cisco CRA Editor


This chapter describes how to install and use the interface and features of the Cisco Customer Response Applications (CRA) Editor.

This chapter contains the following topics:

Overview

The Cisco CRA Editor is a visual programming environment for creating telephony and multimedia application scripts. You can use the CRA Editor on any computer that has access to the CRA server.

The CRA Editor simplifies script development by providing blocks of contact-processing logic in easy-to-use Java-based steps. Each step has its own unique capabilities, from simple increment to generating and playing out prompts, obtaining user input, queueing calls, or performing complex database operations.

Although the steps are written in Java, you do not need to understand Java programming to build a CRA script. You can assemble a script by dragging step icons from a palette on the left pane of the workspace to the design area on the right pane of the workspace.

The CRA Editor supplies the code required to connect the steps; you provide the variable definitions and other parameters. You can validate and debug the completed script directly in the CRA Editor.


Note   Any script created prior to CRA 3.0 will run under CRA 3.0. If, however, you want to modify a pre-existing script, the CRA Editor may prompt you to convert it. For more information on converting scripts to CRA 3.0, and for a detailed comparison of CRA 2.x and CRA 3.0, see "Converting CRA 2.x to CRA 3.0."

CRA Editor Installation

Use a web browser to download the CRA Editor installation program onto any computer that can access the CRA Administration web interface.

Prerequisites

To use the CRA Editor, you need to install one of the following operating systems:

  • Windows 98
  • Windows NT (Workstation or Server) with Service Pack 4 or later
  • Windows 2000 (Professional or Server)
  • Windows XP Professional

Internet Explorer version 5.x or 6.0 is the recommended web browser for the Cisco CRA family of products.

This section includes the following topics:

Downloading the CRA Editor

To download the CRA Editor from the Cisco Customer Response Applications Administration web interface, perform the following procedure:

Procedure

Step 1   Use your web browser to enter the following URL:

http:// <servername>/AppAdmin


Note    In this example, servername is the IP address or host name of your Cisco CRA server.

The Customer Response Applications Administration web page appears. (See Figure 1-1.)


Figure 1-1   Customer Response Applications Administration Web Page


Step 2   From the CRA Administration menu bar, choose Tools > Plug-ins, as shown in Figure 1-1.

The Plug-ins web page appears. (See Figure 1-2 .)


Figure 1-2   Plug-ins Web Page


Step 3   Click the Cisco CRA Editor hyperlink.

The Download CRA Editor (Step 1) web page appears. (See Figure 1-3 .)


Figure 1-3   Download CRA Editor Web Page—Step 1


Step 4   Click Download the Directory Access Configuration File.

Depending on your browser and its configuration, one of two results occurs:

  • The File Download dialog box appears, giving you the option of opening the ccndir.ini file or saving it to your computer. In this case, continue to Step 5.
  • A text file appears in your browser. In this case, go to Step 6.

Step 5   If the File Download dialog box appeared when you clicked the download hyperlink in Step 4, take the following actions:

  • Click Save.

The Save As dialog box appears.

  • Choose a directory in which to save the file.

The default directory is c:\Program Files\avvid.

  • Click Save.

The Save As dialog box closes and the ccndir.ini file is stored in the specified directory.


Note    Do not modify the ccndir.ini file. If you do, the CRA Editor will not properly install.

The Download CRA Editor (Step 2) web page appears. (See Figure 1-4 .)

Go to Step 7.


Figure 1-4   Download CRA Editor Web Page—Step 2


Step 6   If a text file appeared in your browser when you clicked the download hyperlink in Step 4, take the following actions:

  • Choose File > Save As from the menu bar on your browser.

The Save As dialog box appears.

  • Choose a directory in which to save the file.

The default directory is c:\Program Files\avvid.

  • Click Save.

The Save As dialog box closes and the ccndir.ini file is stored in the specified directory.


Note    Do not modify the ccndir.ini file. If you do, the CRA Editor will not properly install.

  • Click the Back button on your browser.

The Download CRA Editor (Step 2) web page appears. (See Figure 1-4 .)

Continue to Step 7.

Step 7   On the Download CRA Editor (Step 2) web page, click Download the License Properties File.

A web page containing text appears in your browser window.

Step 8   From your browser menu bar, choose File > Save As.

The Save As dialog box appears.

Step 9   Choose a directory in which to save this license.properties file.

The default directory is c:\Program Files\avvid.


Note    Make sure you store the license.properties file in the same folder as the ccndir.ini file.

Step 10   Click Save.

The Save As dialog box closes, and the license.properties file is stored in the specified directory.

Step 11   Click the Back button on your browser.

The Download CRA Editor (Step 3) web page appears. (See Figure 1-5 .)


Figure 1-5   Download CRA Editor Web Page—Step 3


Step 12   Click Download and Execute the CRA Editor Installer.

Depending on your browser and its configuration, either a File Download dialog box or a Save As dialog box appears.

Step 13   Using either the File Download dialog box or the Save As dialog box, choose a directory in which to store the executable file that contains the CRA Editor.

The default directory is c:\Program Files\avvid.


Note    Make sure you store the executable CRA Editor file in the same folder as the ccndir.ini and license.properties files.

Step 14   Click Save.

The CRA Editor executable file (CiscoCRAEditorv3.0exe) begins downloading.

When the file has completely downloaded, you are ready to install the CRA Editor.

Follow the procedure in the "Installing the CRA Editor" section.





Installing the CRA Editor

To install the CRA Editor on your computer, perform the following procedure:

Procedure

Step 1   In the directory where you stored the three downloaded CRA Editor files, double-click the executable CRA Editor file (CiscoCRAEditorv3.0exe).

The default directory is c:\Program Files\avvid.

The InstallShield Wizard appears and begins extracting files for the installation. (This process may take a few minutes.)

Step 2   At the Welcome prompt, click Next.

The Software License Agreements dialog box appears.

Step 3   Read the software license agreements, then click Yes.

The Choose Destination Location dialog box appears.

Step 4   Take one of the following actions:

  • Click Next to accept the default directory option, C:\program Files\wfavvid.

The Select Components dialog box appears.

  • Perform the following procedure to choose a different destination:
    • Click Browse.

The Choose Folder dialog box appears.

  • Browse to the desired location, and then click OK.

The Choose Folder dialog box closes, and the destination appears in the Choose Destination Location dialog box.

  • Click Next.

The Select Components dialog box appears.

Step 5   In the Select Components dialog box, make sure that CRA Editor check box (the only option) is checked, and click Next.

The Select Program Folder dialog box appears.

Step 6   In the Select Program Folder dialog box, accept the default location to add program icons to the program folder, or take one of the following actions:

  • type the name of the new folder.
  • from the list of folders, choose the folder in which you want to store the program icons.

Click Next.

The Start Copying Files dialog box appears.

Step 7   In the Start Copying Files dialog box, take one of the following actions:

  • to change any of your previous choices, click Back, make the desired changes, and then return to the Start Copying Files dialog box and click Finish.
  • If you accept all your choices, click Finish.

The InstallShield Wizard closes, and the CRA Editor is installed at the indicated destination.





The CRA Editor Window

The Cisco CRA Editor provides a means to develop a wide variety of interactive scripts.

To start the CRA Editor, use the following path:

Start > Programs > Cisco CRA Developer> Cisco CRA Editor

The Cisco Customer Response Applications Editor window appears. (See Figure 1-6.)


Figure 1-6   Cisco Customer Response Applications Editor Window


The following table describes the four panes of the CRA Editor window:

1

Palette pane

Use the Palette pane to choose the steps you need to create your script.
2

Design pane

Use the Design pane to create your script.

3

Debug pane

Use the Debug pane to view messages when you are validating or debugging a script.

4

Variable pane

Use the Variable pane to create, modify, and view variables for your script.

This section includes the following topics:

Using the Menu Bar

The following sections describe how to use the menu bar options in the Cisco CRA Editor window.

The File Menu

Use File menu options to perform a variety of tasks with files.

Table 1-1 describes the File menu options:

Table 1-1   File Menu Options

Option Description

New

Creates a new script and places a Start step in the Design pane.

(The Start step is the first step of every new script.)

Open

Displays a standard Open window that allows you to choose and open an existing script (.aef) file.

Use the Open option to modify an existing script.

Close

Closes the current script file.

Save

Saves the current script file.

Save As

Opens a standard Save As window that you can use to save your current script by entering a filename with an .aef extension.

Palette

Provides four options:

  • Load Jar—Loads Java (.jar) files containing custom steps that conform to the Cisco CRA Editor interface specification.

See the "Customizing a Step" section for more information.

  • Open Palette—Opens a palette of previously saved steps.
  • Save Palette—Saves the current step palette.
  • Save Palette As—Displays a Save window that you can use to enter a name to save the current step palette.

Print

Prints the current file.

Properties

Provides two tabs:

  • General—Describes the type, location, and size of the opened file.
  • Summary—Provides fields you can use to enter descriptive information about the opened file.

The Edit Menu

Use Edit menu options to perform various editing tasks.

Table 1-2 describes the Edit menu options:

Table 1-2   Edit Menu Options

Option Description

Undo

Undoes last action

Redo

Redoes last action

Cut

Cuts selected items

Copy

Copies selected items

Paste

Pastes selected items

The Tools Menu

The only Tools menu option is Validate.

Use the Validate menu option to check that your script sequence and your step properties usage conform to the general syntax that the CRA Engine requires.

The Debug Menu

Use Debug menu options to test your completed script on a local or remote CRA Engine.

Table 1-3 describes the Debug menu options:

Table 1-3   Debug Menu Options

Option Description

Start/Continue

Runs the current script in debug mode.

Break

Stops the script to allow you to view or change the current values of variables and step properties before resuming execution.

End

Ends the current script.

Step Over

Executes one step.

Insert/Remove Breakpoint

Inserts a breakpoint at the currently executing step. This insertion causes the script to halt whenever it runs in debug mode, but it does not affect the run-time version of the script.

Enable/Disable Breakpoint

Toggles the selected breakpoint on or off.

Clear All Breakpoints

Removes all breakpoints from the script.

Reactive Scripts

Prompts for the name and timeout setting of the event-triggered script to be debugged.

The Window Menu

Use Window menu options to control how multiple files appear in the Design pane.

Table 1-4 describes the Window menu options:

Table 1-4   Window Menu Options

Option Description

Cascade

Displays files as stacked windows

Tile Horizontally

Displays files as equal windows tiled horizontally

Tile Vertically

Displays files as equal windows tiled vertically

The Settings Menu

The only Settings menu option is ICM Variables. (This option applies only to IP Queue Manager [IP QM].)

Use the ICM Variables option to manage expanded call variables for Intelligent Contact Manager (ICM) steps.

The Help Menu

The only Help menu option is Help.

Use the Help menu option to search the contents of the Help file.

Using the Toolbar

The CRA Editor toolbar provides icons you click to choose some of the same Cisco CRA Editor options that you access from the menu bar. (See Figure 1-7 .)


Figure 1-7   Cisco CRA Editor Toolbar


Table 1-5 describes the function of each tool on the toolbar.

Table 1-5   Toolbar Functions

Description
1

Creates a new script

2

Opens a script

3

Saves a script

4

Prints selected file

5

Cuts selected item

6

Copies selected item

7

Pastes selected item

8

Undoes previous command

9

Redoes previous command

10

Starts running the script

11

Breaks running of the script

12

Stops running the script

13

Runs debugging process one step at a time

14

Inserts breakpoint in debugging process

15

Enables breakpoint in debugging process

16

Clears all breakpoints in debugging process

The Palette Pane

The Palette pane of the Cisco CRA Editor contains all the steps available for developing scripts. (See Figure 1-8 .)


Note   For complete descriptions of the steps in every CRA Editor palette, refer to the Cisco Customer Response Applications Editor Step Reference Guide.


Figure 1-8   Cisco CRA Editor Palette Pane



Note   Depending on the CRA package and add-on options you licensed, some palettes and/or steps described here may not be available.

This section includes the following topics:

Using Steps from the Palette Pane

To display the contents of a palette, click the plus sign (+) to the left of the palette icon in the Palette pane.

To create your script, drag the steps you want from the Palette pane and drop them, in their desired order, into the Design pane. Each step performs a specific function and creates a portion of the underlying programming. You can customize most of the steps once you have placed them in the Design pane.

Your cursor will display the international prohibited sign until you move a step into a location that the CRA Editor allows.


Note   If you try to drag a step to the Design pane when a customizer window is open, the Design pane will not accept the step. Before you drag a step to the Design pane, close any open customizer window(s), one or more of which may be hidden behind the CRA Editor window.

Importing Steps

You can add custom steps to the Palette pane to use in your scripts.

To add steps to the Palette pane, perform the following procedure:

Procedure

Step 1   From the CRA Editor menu bar, choose File > Palette > Load Jar.

The Open Jar dialog box appears. (See Figure 1-9 .)


Figure 1-9   Open Jar Dialog Box


Step 2   Take one of the following actions:

  • In the Address text field, enter the URL or path to your .jar file, and then click OK.
  • Navigate to the directory that contains your .jar file:
    • Click Browse, browse to the directory that contains your .jar file, and then click Open.

The path to your .jar file appears in the Address text field of the Open Jar dialog box.

  • Click OK.

The Open Jar dialog box closes, and the custom step icon appears in the Palette pane of the CRA Editor.





The Design Pane

The Design pane of the Cisco CRA Editor is the location where you perform the largest portion of your script development.

This section describes the following topics:

  • Creating a Script, page 2-11
  • Customizing a Step, page 2-13

Creating a Script

To begin a new script in the Design pane of the CRA Editor window, choose File > New. The CRA Editor adds the Start step automatically and provides the starting point to which you add your steps.

To add a step to your script, drag the step icon from the Palette pane and drop it onto the step it will follow in the Design pane. Place the steps in logical order for the script you are building.

To change the order of a step in the script, drag the individual step icon from its old location to its new location. To delete a step, select the step icon and press the Delete key.

Figure 1-10 shows an example of how a script displays in the Design pane.


Figure 1-10   Script Example in the Design Pane


Many steps have output branches under which you add steps to provide desired script logic based on the exit condition of the step.

In Figure 1-10 above, for example, the Simple Recognition step has five output branches:

  • DialByExtn
  • DialByName
  • Operator
  • Timeout
  • Unsuccessful

Output branches often contain steps and other output branches. In Figure 1-10 , for example, the DialByExtn output branch contains five steps below it, one of which (the Get Digit String step) contains three output branches.

To expand the script under a step, click the plus sign to the left of the step icon. To contract the script under a step, click the minus sign to the left of the step icon.

At run time, each script follows a hierarchical sequence, as indicated by the vertical lines connecting steps. In Figure 1-10 , for example, if the script reaches the Timeout output branch of the Get Digit String step, it will fall through to the next step at the level of the Simple Recognition step, which, in this example, is the Play Prompt step.

Customizing a Step

You can customize most of the steps in the CRA Editor by opening windows called customizer windows. A customizer window contains fields you can configure to meet the needs of your script. The configuration fields on the customizer windows are called properties.

To display the customizer window for a CRA Editor step, perform the following procedure:

Procedure

Step 1   Drop the step icon into the Design pane, and then right-click it.

The Properties popup menu appears. (See Figure 1-11, which shows the Menu step Properties popup menu as an example.)


Figure 1-11   Properties Popup Menu—Menu Step


Step 2   Choose Properties.

The customizer window of the step appears. (See Figure 1-12, which shows the Menu customizer window as an example.)


Figure 1-12   Menu Customizer Window


Use the customizer window of each step to configure the properties of that step.





Customizer windows have text fields that you use to configure properties. They may have multiple tabs.

Each customizer window contains four buttons:

  • OK—Applies the changes and closes the customizer window.
  • Apply—Applies the changes without closing the customizer window.
  • Cancel—Closes the customizer window without applying any changes.
  • Help—Displays context-sensitive help for this step.

Customizer windows may also have additional buttons that you use to modify and display various properties within a step.

The Variable Pane

The Variable pane of the Cisco CRA Editor is the location where you add and modify the variables used by the script.

Variables store data while a script executes.

Any step in your script can use variables once you define them in the Variable pane of the CRA Editor window. (See Figure 1-6.)

You can also map variables you define for your script to variables you define in a subflow. A subflow can use and manipulate a variable, then return the data that is stored in the variable to the primary script. Scripts cannot share variables with other scripts, except in the case of default scripts, in which the primary script automatically transfers the values of its variables to a default script. (See Using Default Scripts.)

The value of a variable can change during execution.

This section includes the following topics:

Defining Variables

To define a new variable, click the New Variable icon at the top left corner of the Variable pane of the CRA Editor window.

The Edit Variable window appears. (See Figure 1-13.)


Figure 1-13   Variable Pane and Edit Variable Window


1

New Variable icon

2

Delete Variable icon

3

Modify Variable icon

After you use the Edit Variable window to define your variables, the variables appear in the Variable pane. You can select a variable and use the Modify or Delete icons in the toolbar of the Variable pane to make any necessary changes.

Table 1-6 describes the fields in the Edit Variable window.

Table 1-6   Edit Variable Properties

Property Description

Name

Name of the variable you want to declare.

Type

Type of variable you want to declare.

Java Type

Fully qualified class name located using the CLASSPATH environment variable on your computer.

Note You can edit this field only when Java Type is chosen in the Type drop-down menu. In all other cases, the field displays the actual Java type corresponding to the built-in data type chosen in the Type drop-down menu.

Value

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

Parameter

If checked, sets the value for this parameter in the CRA Administration web interface when you provision applications that use this script.

Using Basic Built-in Variable Types

The following sections describe the following basic built-in variable types:

Boolean

A Boolean variable can be either true or false, and is primarily used by the If step in the General palette of the CRA Editor.

  • Java Class Name—java.lang.Boolean
  • Variable Input Format:
    • t, f
    • true, false

Character

A Character variable consists of characters, such as the letters in an alphabet.

  • Java Class Name—java.lang.Character
  • Variable Input Format:
    • "a", "1", "Z", and so forth
    • any escape sequence: "\t", "\r", "\0", "\n", "\f", "\\", "\"
    • "\uXXXX" can be used to represent any character using the character hexadecimal Unicode number XXXX

Document

A Document variable can be any type of document, such as a file, a URL, or a recording.

  • Java Class Name—com.cisco.doc.Document
  • Variable Input Format:
    • FILE[C:\Documents\mydoc.txt]—Same functionality as the Create File Document step.
    • URL[http://evbuweb/mydoc.asp?number=23]
    • TEXT[Some text to be stored in document]—Allows the creation of an in-memory document representation of the specified string.

Float

A Float variable consists of decimal numbers.

  • Java Class Name—java.lang.Float
  • Variable Input Format (examples):
    • 3.14159
    • 2E-12
    • -100

Integer

An Integer variable consists of whole numbers, from -2147483648 to 2147483647, inclusive.

  • Java Class Name—java.lang.Integer
  • Variable Input Format (examples):
    • 234556789
    • 0
    • -23

String

A String variable consists of a set of Unicode characters, from "\u0000" to "\uffff" inclusive.

  • Java Class Name—java.lang.String
  • Variable Input Format (examples):
    • "Hello", "C:\WINNT\win.ini"—This format does not support any escape characters or Unicode characters.
    • u"\"This is a quoted string\"", u"\tHello", u"\u2222\u0065", u"C:\\WINNT\\win.ini", and so forth. This format supports the same escape sequences or Unicode characters described for the Character type. (See Character.)

Date

The Date variable contains date information.

  • Java Class Name—java.util.Date
  • Variable Input Format (examples):
    • D[12/13/52]
    • D[Dec 13, 1952]
    • D[January 20, 1952]
    • D[Tuesday, April 12, 1952]
    • D[12/13/52]
    • D[12/13/52 5:50 PM]
    • D[April 1, 2001 12:00:00 AM PST]

The parameter specified in between D[] is parsed based on any combination of the following two formats:

  • "<date>"
  • "<date> <time>"

The CRA Editor supports four <date> specification formats:

  • SHORT is completely numeric, such as "12/13/52"
  • MEDIUM is somewhat longer, such as "Jan 12, 1952"
  • LONG is longer, such as "January 12, 1952"
  • FULL is completely specified, such as "Tuesday, April 12, 1952"

Time

The Time variable contains time information.

  • Java Class Name—java.sql.Time
  • Variable Input Format (examples):
    • T[3:39 AM]
    • T[11:59:58 PM EST]

The parameter specified inside brackets of T[] is parsed based on the format "<time>".

The CRA Editor supports three <time> specification formats:

  • SHORT is short, such as "3:30 PM"
  • MEDIUM is longer, such as "3:30:32 PM"
  • LONG and FULL (which are identical) are more complete, such as "3:30:42 PM PST"

BigDecimal

The BigDecimal variable consists of an arbitrary-precision integer along with a scale, where the scale is the number of digits to the right of the decimal point.

  • Java Class Name—java.math.BigDecimal
  • Variable Input Format (examples; same as Float variable):
    • 3.14159
    • 2E-12
    • -100

BigInteger

The BigInteger variable represents arbitrary-precision integers.

  • Java Class Name—java.lang.BigInteger
  • Variable Input Format (examples; same as Integer variable):
    • 234556789
    • 0
    • -23

Double

The Double variable represents an expanded Float variable.

  • Java Class Name—java.lang.Double
  • Variable Input Format (examples; same as Float variable):
    • 3.14159
    • 2E-12
    • -100

Long

The Long variable is an expanded Integer variable.

  • Java Class Name—java.lang.Long
  • Variable Input Format (examples; same as Integer variable):
    • 234556789
    • 0
    • -23

Exporting Variables

You can declare variables as parameters by checking the Parameter check box in the Edit Variables dialog box.

This feature allows you to set the value for a parameter in the CRA Administration web interface. Because the value is initialized at configuration time for the script that uses it, you can change the value without having to edit the script in the CRA Editor. Such a variable is called an exported variable.

For example, when you create an application of type "Cisco Script Application", you can choose either a script or a default script. The system then refreshes the web page and provides a list of the parameters with their default or current values. You can modify the values in this list.

The variable types that Cisco CRA 3.0 supports for parameters include number, string, Boolean, document, prompt, and grammars.

Expressions

Expressions are useful if you do not know the exact value at design time and instead enter a formula that can be evaluated at run time. The resulting type of the expression must match the expected input type or types (which you check at design time).

Many steps include an Expression Editor (...) button in the customizer window, which you can use to enter an expression. (See Figure 1-14.)


Figure 1-14   Example of an Expression Editor Button in a Customizer Window


You can type an expression directly in the input text field, or click the Expression Editor (...) button to open the Expression Editor. (See Figure 1-15 .)


Figure 1-15   Expression Editor


You can enter the expression in the text field, or you can use the Variable drop-down menu to get quick access to variables you have previously defined in the script. When you choose a variable from the Variable drop-down menu, the variable name appears in the input text field.

After you enter the expression, click OK.

The Expression Editor closes.

This section includes the following topics:

Using Expression Input Formats

This section describes the expression input formats for the following variable types:

Boolean

The expression input format for the Boolean variable is true, false.

Character

The expression input format for the Character variable is the same as for its variable input format:

  • "a", "1", "Z", and so forth
  • any escape sequence: "\t", "\r", "\0", "\n", "\f", "\\", "\"
  • "\uXXXX" can be used to represent any character using the character hexadecimal Unicode number XXXX

Document

The expression input format for the Document variable is the same as for its variable input format:

  • FILE[C:\Documents\mydoc.txt]—Same functionality as the Create File Document step.
  • URL[http://evbuweb/mydoc.asp?number=23]
  • TEXT[Some text to be stored in document]—Allows the creation of an in-memory document representation of the specified string.

The parameter specified inside the bracket of FILE[], URL[], and TEXT[] can also be the result of any string expression. For example, FILE[u"C:\\MyDocuments\\" + filename].

Float

The expression input format for the Float variable is the same as for its variable input format:

  • 3.14159
  • 2E-12
  • -100

The script keeps all Float values in Double representation and type casts down only when it assigns the value to a Float variable. This feature prevents any loss in precision by how Java stores Float values.

If the script cannot hold the value by a Float, the script automatically stores the value as a BigDecimal and type casts it to a Float when it assigns the value to a variable, with some loss in precision.

Integer

The expression input format for the Integer variable is the same as for its variable input format:

  • 234556789
  • 0
  • -23

The script first parses the value as an Integer. If this attempt is unsuccessful, the script parses the value as a Long. If this attempt fails, the script parses the value as a BigInteger. The script may type cast the value to an Integer when the value is assigned to a variable. If the script cannot represent the value as an Integer, the result may be unknown.

String

The expression input format for the String variable is the same as the variable input format:

  • "Hello", "C:\WINNT\win.ini"—This format does not support any escape characters or Unicode characters.
  • u"\"This is a quoted string\"", u"\tHello", u"\u2222\u0065", u"C:\\WINNT\\win.ini", and so forth. This format supports the same escape sequences or Unicode characters described for the Character type.

Date

The expression input format for the Date variable is the same as for its variable input format:

  • D[12/13/52]
  • D[Dec 13, 1952]
  • D[January 31, 1952]
  • D[Tuesday, April 12, 1952]
  • D[12/13/52]
  • D[12/13/52 5:50 PM]
  • D[April 1, 2001 12:00:00 AM PST]

The script parses the parameter specified in between D[] based on any combination of the following two formats:

  • "<date>"
  • "<date> <time>"

The CRA Editor supports four <date> specification formats:

  • SHORT is completely numeric, such as "12/13/52"
  • MEDIUM is longer, such as "Jan 12, 1952"
  • LONG is longer, such as "December 23, 1952"
  • FULL is completely specified, such as "Tuesday, April 12, 1952"

The <time> specification supports the following three formats:

  • SHORT, such as "3:30 PM"
  • MEDIUM is longer, such as "3:30:32 PM"
  • LONG and FULL are identical and more complete, such as "3:30:42 PM PST"

Time

The expression input format for the Time variable is the same as for its variable input format:

  • T[3:39 AM]
  • T[11:59:58 PM EST]

The script parses the parameter specified inside brackets of T[] on the following three format specifications:

  • SHORT, such as "3:30 PM"
  • MEDIUM is longer, such as "3:30:32 PM"
  • LONG and FULL are identical and more complete, such as "3:30:42 PM PST"

BigDecimal

The expression input format for the BigDecimal variable is the same as for its variable input format:

  • 3.14159
  • 2E-12
  • -100

BigInteger

The expression input format for the BigInteger variable is the same as for its variable input format:

  • 234556789
  • 0
  • -23

Double

The expression input format for the Double variable is the same as for its variable input format:

  • 3.14159
  • 2E-12
  • -100

If the script cannot hold the value by a Double, the script automatically stores it as a BigDecimal and type casts it down to a Double when the script assigns a value to a variable, with some loss in precision.

Long

The expression input format for the Long variable is the same as for its variable input format:

  • 234556789
  • 0
  • -23

The script first parses the value as a Long and if it fails, the script parses the value as a BigInteger. The script may type cast the value to a Long when the script assigns the value to a variable. If the script cannot represent the value as a Long, the result may be unknown.

Using Operators with the Expression Editor

The CRA Editor accepts the following operators, which are listed in order of execution priority:

1. Parentheses (...)—Works with any expression; allows you to give priority to the expression contained in the parentheses.

2. Multiplication (*), Division (/)—Works with any number expression (integer, long, float, decimal, BigInteger, BigDecimal)

Number operands are properly promoted to a valid type before testing.

3. Addition (+), Subtraction (-)—Works with any number expression (integer, long, float, decimal, BigInteger, BigDecimal)

Number operands are properly promoted to a valid type before testing.

4. Less Than (<), Greater Than (>), Less Than or Equal (<=), Greater Than or Equal (>=)

Comparison operands work only on String, Character, and Number operands.

5. Equal to (==), Not Equal to (!=)

Testing for the <null> constant is supported by the two equality operators.

All type objects can be tested using the Object.equals( ) method of the first operand. (This feature can be useful if you want to create your own java classes.)

6. And (&&)— Works only with Boolean expressions.

7. Or (||)—Works only with Boolean expressions.

8. Concatenation (+)

If at least one of the operands is a String, and the other one is not a prompt, then the other one is converted to a String using the String.value( ) method and the result is a new String corresponding to the concatenation of the String representation of both operands. Typically the String.valueOf() method simply calls the toString() method of the object being concatenated or returns the string "null" if the object is null.

If the operands are Characters, then they are concatenated together, resulting in a new String.

The Debug Pane

You can use the Debug pane once you complete your script and you are ready to validate and debug it.

Two procedures are available to do this: reactive debugging and non-reactive debugging.

In both procedures, you can insert, delete, enable, and disable breakpoints after you have opened the script window. Information appears in the Debug pane telling you whether or not your script is valid.

Also in both procedures, you can insert a breakpoint at a step to stop the debug process at that step. You can continue the process by choosing one of the two menu options from the CRA Editor menu bar:

  • Debug > Continue
  • Debug > Step Over

When you choose Debug > Step Over, the debug process proceeds one step at a time, then halts. You must therefore continue to choose Debug > Step Over, or press the F10 function key, until you reach the end of the script. You can also remove the breakpoint by choosing Debug > Remove Breakpoint.

This section includes the following topics:

Using Reactive Debugging

Use the Reactive Debugging procedure to debug scripts that depend on external events for their execution. For example, the Cisco CRA script aa.aef depends on an external call event (an incoming call) to trigger its execution.

This procedure is also the only way you can debug Voice Response Unit (VRU) scripts, by registering for the script filename. When the call starts, the CRA Engine runs the associated scripts normally until the system reaches the one for which you registered a reactive debugging session. The system starts debugging the script at that point.

Use the CRA Administration script management web pages to register all scripts that require event-triggered debugging by uploading the script to the Repository. Every time you edit the script, you must re-register it.

To debug a reactive script, perform the following procedure:

Procedure.

Step 1   From the CRA Editor menu bar, choose Debug > Reactive Script.

The Reactive Script Information for Debugging dialog box appears. (See Figure 1-16 .)


Figure 1-16   Reactive Script Information Dialog Box

<

Step 2   In the Script File Name text field, enter the filename of the script you want to debug, or use the drop-down menu to choose the desired filename.


Note    The script name should exactly match the one you supply when configuring the script using the Scripts > Manage Scripts option on the CRA Administration web interface.

Step 3   In the Wait Time (Secs) text field, enter the amount of time you want the CRA Engine to wait for the result of a triggering event or to wait for a Run VRU Script request from the Cisco ICM.


Note    The CRA Engine must be running, and the computer you are using must have a connection to the CRA server.

Step 4   Click OK.

How the event is invoked depends on the type of event required. For example, for the Cisco IP IVR (Interactive Voice Response) script aa.aef, the system makes a call to the required number and the script window appears in the Design pane of the CRA Editor.

Step 5   Choose Debug > Continue to allow the system to continue debugging, or Debug > Step Over to debug one step at a time.

Step 6   Correct any errors flagged by the system prompt in the CRA Editor.





Using Non-Reactive Debugging

Use this procedure to debug scripts that do not require external events for their execution (for example, scripts that derive their steps from the General or Database palettes alone). This procedure is also useful for debugging script segments or subflows.


Tip You can create a script that first uses the Place Call step to place an outbound call, and then continues the script using that outbound call. This procedure makes it easy to debug a script that will be triggered by calls, without the complexity of uploading the script to the Repository every time you want to debug and test it. Note that all Media and Call Control steps need to use the call object that the Place Call step returns instead of the default "-- Triggering Contact --".

You can create, validate, and debug scripts that do not require connectivity to the CRA Engine directly from the CRA Editor.


Note   If you are using subflows, the debug process does not enter and debug the subflows. The debug process will execute the subflow without providing debug controls while executing it. (This process is exactly like stepping over the Call Subflow step.)

To debug a non-reactive script, perform the following procedure:

Procedure

Step 1   With an existing or new script open in the CRA Editor Design pane, choose Debug > Start from the CRA Editor menu bar.

The CRA Editor debugs the script and flags any errors.

Step 2   In the CRA Editor, correct any errors flagged by system prompts.

Step 3   Continue to use the Debug command until you have cleared all error flags.





Basic Error Handling

The CRA Editor allows you to provide scripts with a variety of ways to handle errors.

This section describes the two basic ways that scripts can handle errors.

Continue on Prompt Errors

The Continue on Prompt Errors option allows the script to continue to execute when the script receives invalid input (for example, Invalid Audio Format or File Not Found).


Note   This feature was the default in previous releases of CRA; the script always ignored prompt errors. With CRA 3.0, you now have the ability to choose how to handle these type of errors.

The CRA Editor provides the Continue on Prompt Errors option in the customizer windows of steps in the Media palette, as shown in Figure 1-17 , which shows the Prompt tab of the Get Digit String customizer window.


Figure 1-17   Continue on Prompt Errors Option—Prompt Tab of the Get Digit String Customizer Window


When enabled, the step continues with the next prompt in the list of prompts to be played back, or, if it is the last step in the list, it waits for caller input.

When you enable Continue on Prompt Errors, you instruct the script to ignore prompt errors and continue as if the playback of a particular prompt was successful. For example, in a sequence of prompts "1 + 2 + 3", if prompt #1 fails, the step will continue with prompt #2. If prompt #3 fails, the step will continue, waiting for caller input as if prompt #3 had been properly played back.

When you disable Continue on Prompt Errors, the media steps generate an exception, which can then be handled in the script.

Prompt exceptions are as follows:

  • PromptException
  • UndefinedPromptGenerator
  • TTSPromptProviderException
  • UndefinedPrompt Exception
  • InvalidPromptArgumentException
  • UnsupportedPromptExpression

Error Output Branches

Error output branches contain logic that provides instructions on what to do when typical errors occur.

Figure 1-18 shows error output branches under a Call Redirect step in a script.


Figure 1-18   Error Output Branches—Call Redirect Step


In this example, the Call Redirect step includes logic for both an invalid extension and an out-of-service extension.


Note   The script provides error branches only for expected error conditions, not for system errors.