Cisco Customer Response Applications Editor Step Reference Guide (3.1)
General Step Descriptions

Table of Contents

General Step Descriptions
Annotate
Call Subflow
Day of Week
Decrement
Delay
End
Get Reporting Statistic
Goto
If
Increment
Label
On Exception Clear
On Exception Goto
Set
Start
Switch
Time of Day

General Step Descriptions


The steps in the General palette of the Cisco Customer Response Applications (CRA) Editor provide basic programming functionality for scripting.

The General palette contains the following steps:

Figure 1-1 shows the steps in the General palette as they appear in the Palette pane of the CRA Editor.


Figure 1-1   General Palette Steps


Annotate

Use the Annotate step to enter comments that explain the function of a script segment.

Figure 1-2 shows the customizer window for the Annotate step.


Figure 1-2   Annotate Customizer Window


To use the Annotate customizer window to annotate a script, enter your comments in the Enter Comments field, and then click OK.

The Annotate customizer window closes, and the first words of your annotation appear next to the Annotate icon in the Design pane of the CRA Editor.

This step has no effect on script logic.

Call Subflow

Use the Call Subflow step to execute a subflow, which is analogous to a subroutine or module in structured programming.

You create the subflow with the CRA Editor as an independent script that you can reuse in other scripts. You can also call subflows from within scripts that are themselves used as subflows.

If the script was originally loaded from disk, the subflow script must reside in the same folder as the script that calls it. If the script was loaded from the Repository, then the subflow must also reside in the Repository.


Note   When you debug a script that uses subflows, the CRA Editor does not debug the subflows; it checks only the script you are debugging. You must ddebug each subflow separately. The debug validation process does not detect mapping of mismatched types, but such a mapping causes a run-time exception when the script is loaded into the execution engine.

During run time, if an exception occurs within a subflow, and you do not handle the exception within the subflow, the exception is available to the parent script for processing. For more information about exceptions, see the "On Exception Goto" section.

The Call Subflow customizer window contains two tabs:

The following sections describe these tabs.

General Tab

Use the General tab of the Call Subflow customizer window to specify the file name of the subflow you want to call.

Figure 1-3 shows the General tab of the Call Subflow customizer window.


Figure 1-3   Call Subflow Customizer Window—General Tab


Table 1-1 describes the properties of the General tab of the Call Subflow customizer window.

Table 1-1   Call Subflow Properties—General Tab

Property Description

Subflow Name

File name of the subflow you want to call

Disable Interruptions

If check box is checked, execution of the step can not be interrupted by external events.

To use the General tab of the Call Subflow customizer window to call a subflow, perform the following procedure:

Procedure

Step 1   If necessary, click the General tab.

The General tab of the Call Subflow customizer window appears.

Step 2   In the Subflow Name text field, enter the file name of the script that contains the desired subflow.

Step 3   If you want to prevent external events from interrupting the Call Subflow step, check the Disable Interruption check box.

Step 4   Click Apply.

You are now ready to configure the Parameter Mapping tab of the Call Subflow customizer window.





Parameter Mapping Tab

Use the Parameter Mapping tab of the Call Subflow customizer window to map variables or expressions from the main script to variables in the subflow you specified in the General tab of the Call Subflow customizer window.


Note   You must define variables in the map script before you can map them.

You can map variables only to variables of the same type. (For example, you can map a string variable in the main script only to a string variable in the subflow).

You can pass in any valid expression; for example, "4" or an expression like "counter + 3".

When you call a subflow, the subflow has access to the variables from the main script that you explicitly map on the Parameter Mapping tab. If you change the value of a mapped variable, that change carries over to the main script when the subflow returns control to the main script.

Figure 1-4 shows the Parameter Mapping tab of the Call Subflow customizer window.


Figure 1-4   Call Subflow Customizer Window—Parameter Mapping Tab


Table 1-2 describes the properties of the Parameter Mapping tab of the Call Subflow customizer window.

Table 1-2   Call Subflow Properties—Parameter Mapping Tab

Property Description

From

Name of the variable from the main script that will receive the value of the variable from the subflow script

To

Name of the variable from the subflow script that will be assigned to the variable in the main script

Type

Variable type

To use the Parameter Mapping tab of the Call Subflow customizer window to add variables or expressions to be mapped, perform the following procedure:

Procedure

Step 1   If necessary, click the Parameter tab.

The Parameter tab of the Call Subflow customizer window appears.

Step 2   Click Add.

The Parameter Mapping dialog box appears. (See Figure 1-5 .)


Figure 1-5   Parameter Mapping Dialog Box


Step 3   In the From Expression field, enter the variable name or expression from the main script.

Step 4   In the To Variable field, enter the variable name from the subflow.

Step 5   Click OK to add the mapping to the script.

The Parameter Mapping dialog box closes, and the names of variables and the type of the variable you chose in the To variable text field appear in the list box of the Call Subflow window.

Step 6   Click OK.

The Call Subflow customizer window closes, and the script name you call appears next to the Call Subflow step icon in the Design pane of the CRA Editor.





Day of Week

Use the Day of Week step to cause the script to branch to different connection output branches depending on the current day of the week.

Steps that you add following a specific connection branch will execute if the application server system clock indicates that the day of the week matches one of the days associated with that connection.

You must cover all days with output branches, and you must assign each day its own connection(s). If a day is not assigned to at least one output branch, the CRA Editor displays a warning dialog box when you close the Day of Week customizer window.

Figure 1-6 shows the customizer window for the Day of Week step.


Figure 1-6   Day of Week Customizer Window


Table 1-3 describes the properties of the Day of Week customizer window.

Table 1-3   Day of Week Properties

Property Description

Connections

Output branches that execute depending on specified day of week

Days

Days of the week for each connection branch

To use the Day of Week customizer window to add a connection output branch and specify the days of the week to associate with it, perform the following procedure:

Procedure

Step 1   Click Add.

The Add Connection Name dialog box appears. (See Figure 1-7.)


Figure 1-7   Add Connection Name Dialog Box


Step 2   In the Connector Name text field, enter a name for the connection branch, and then click OK.

The Add Connection Name dialog box closes, and the name of the new connection appears in the Connections list box of the Day of Week customizer window.

Step 3   Select the new connection in the Connections list box, and check the check boxes for the days you want to associate with that branch.

(If you want to modify the name of an already existing connection output branch—to make it easier to understand your script, for example—select the connection in the Connections list box, and then click Modify. The Modify Connection Name dialog box appears, which contains the same property as the Add Connection name dialog box and is configured in the same way.)

Step 4   Click OK.

The Day of Week customizer window closes.





Decrement

Use the Decrement step to decrease the value of a chosen Integer variable by one. This step is a specialized version of the Set step of the General palette, which you use to assign any value to a variable.

Figure 1-8 shows the customizer window for the Decrement step.


Figure 1-8   Decrement Customizer Window


To use the Decrement customizer window to decrease the chosen Integer variable by one, choose the desired variable from the Variable drop-down menu, and then click OK.

The Decrement customizer window closes, and the variable appears next to the Decrement step icon in the Design pane of the CRA Editor.

Delay

Use the Delay step to pause the processing of a script for a specified number of seconds.

Figure 1-9 shows the customizer window for the Delay step.


Figure 1-9   Delay Customizer Window


Table 1-4 describes the properties of the Delay customizer window.

Table 1-4   Delay Properties

Property Description

Enter delay time in seconds or enter an expression

Length of time in seconds for the delay, or an expression that specifies the length of the delay.

Interruptible

If Yes is clicked, the delay is interruptible by external events.

To use the Delay customizer window to specify a script processing delay, perform the following procedure:

Procedure

Step 1   In the Enter Delay Time text field, enter the number of seconds for the delay, or click the Expression Editor (...) button to enter any valid expression.

Step 2   If you want to allow external events to interrupt the delay, click the Yes radio button.

Step 3   Click OK.

The Delay customizer window closes, and either the number of seconds or the name of the variable appear next to the Delay step of the Design pane of the CRA Editor.





End

Use the End step at the end of a script to complete processing and free all allocated resources.

You can also use the End step at the end of a branch of logic in a script. Any contact (call, HTTP request, or e-mail) still active by the time this step is executed will automatically be processed by the system default logic.

This step has no properties and does not require a customizer.

Get Reporting Statistic

Use the Get Reporting Statistic step to access real-time information about agents, Contact Service Queues (CSQs), the overall Integrated Contact Distribution (ICD) system, and contacts.

You can use this step to view the current state of the ICD system or to report back to a caller such information as current wait duration, position in queue, and expected wait time.

The system bases the expected wait time calculation on the number of agents in reserved, talking, and work states for this CSQ, the call's position in the queue, and the average call duration for this CSQ. Average call duration of a CSQ is the average time agents spend in Reserved, Talking, and Work states while handling a call from this CSQ.

Figure 1-10 shows the customizer window for the Get Reporting Statistic step.


Figure 1-10   Get Reporting Statistic Customizer Window


Table 1-5 describes the properties of the Get Reporting Statistic customizer window.

Table 1-5   Get Reporting Statistic Properties

Property Description

Contact

Contact for which to get the statistic

Report Object

Type of report: overall ICD, CSQ, or Resource

Field

Specific statistic; for example, Avg Talk Duration.

One of the options for this property is Work Resources. "Work" state is not supported in IP ICD Standard. If you have IP ICD Standard and select either "overall ICD" or "CSQ" for the Report Object, selecting "Work Resources" for the Field property returns "0" when retrieved by the workflow.

Row Identifier

Value used to identify the CSQ or Resource (only applicable to CSQ or Resource reports)

Statistic Variable

Script variable that contains the resulting statistic value

To use the Get Reporting statistic customizer window to specify access to real-time information, perform the following procedure.

Procedure

Step 1   From the Contact drop-down menu, choose the contact to describe.

Step 2   From the Report Object drop-down menu, choose the type of report from which you want to get the statistic.

Step 3   From the Field drop-down menu, choose the specific type of statistic you want to get.

Step 4   From the Row Identifier drop-down menu, either choose the String variable that holds the value used to identify the CSQ or Resource, or click the Expression Editor (...) button to enter an expression that identifies the CSQ or Resource.

Step 5   From the Statistic Variable drop-down menu, choose the Integer variable that will contain the resulting statistic value.

Step 6   Click OK.

The Get Reporting Statistic customizer window closes, and the information you entered appears next to the Get Reporting Statistic step icon in the Design pane of the CRA Editor.





Goto

Use the Goto step to cause the script logic to branch to a specified Label step within the script.


Note   You must create a specific Label step before you can customize the Goto step to branch to that label.

Figure 1-11 shows the customizer window for the Goto step.


Figure 1-11   Goto Customizer Window


To use the Goto customizer window to cause the script logic to branch to a specific Label step, choose that Label step from the Select a Label drop-down menu, and then click OK.

The Goto customizer window closes, and the label name appears next to the Goto step icon in the Design pane of the CRA Editor.

If

Use the If step to cause the script to go to one of two branches based on the evaluation of a specified Boolean expression.

The If step automatically adds two output branches, True and False:

  • True—Steps following this output branch execute if the expression is true.
  • False—Steps following this output branch execute if the expression is false.

Figure 1-12 shows the customizer window for the If step.


Figure 1-12   If Customizer Window


To use the If customizer window to create True and False output branches, either enter an expression in the text field or click the Expression Editor (...) button to enter an expression, and then click OK.

The If customizer window closes, and the expression appears next to the If step icon in the Design pane of the CRA Editor.

Increment

Use the Increment step to increase the value of a chosen Integer variable by one. This step is a specialized version of the Set step of the General palette, which you use to assign any value to a variable.

Figure 1-13 shows the customizer window for the Increment step.


Figure 1-13   Increment Customizer Window


To use the Increment customizer window to increase the value of a specific Integer variable by one, choose that Integer type variable from the Variable drop-down menu, and then click OK.

The Increment customizer window closes, and the variable appears next to the Increment step icon in the Design pane of the CRA Editor.

Label

Use the Label step to insert a label into a script to serve as a target for a Goto step within the same script.

Figure 1-14 shows the customizer window for the Label step.


Figure 1-14   Label Customizer Window


To use the Label customizer window to insert a label into a script, enter a name in the Enter Label Name text field, and then click OK.

The Label customizer window closes, and the Label name appears next to the Label step icon in the Design pane of the CRA Editor.

On Exception Clear

Use the On Exception Clear step to remove an exception set by a previous On Exception Goto step.

Typically, this step is used in the following sequence:

1. An On Exception Goto step directs the script to a Label step.

2. Scripting is placed after the Label step to handle the exception.

3. An On Exception Clear step is then used to clear the exception.

You may also use this step when you no longer need to handle the selected exception within the script.

Figure 1-15 shows the customizer window for the On Exception Clear step.


Figure 1-15   On Exception Clear Customizer Window


To use the On Exception Clear customizer window to clear an exception, select the specific exception from the list box, and then click OK.

The On Exception Clear customizer window closes, and the exception being cleared appears next to the On Exception Clear step icon in the Design pane of the CRA Editor.

On Exception Goto

Use the On Exception Goto step to catch problems that may occur during script execution and allow a graceful exit from the situation.

You can include any script steps in the Exception Flow branch that you want to use to respond to the exception.

If you are using subflows, and the subflow does not handle an exception, the exception is returned to the script and the script can respond to it.

Figure 1-16 shows the customizer window for the On Exception Goto window.


Figure 1-16   On Exception Goto Customizer Window


Table 1-6 describes the properties of the On Exception Goto customizer window.

Table 1-6   On Exception Goto Properties

Property Description

Choose the exception from the list

Exception that triggers the execution of the step.

Choose the label from the list

Label to which the script will branch.

Save root cause (optional)

Cause of the exception, saved in an exception object using the "Save root cause" field.

The object type must correspond to the type of exception being caught or to a base class of that exception. If it does not, no warning will be generated at design time, but an error will result at run time.

To use the On Exception Goto customizer window to create a response to an exception, perform the following procedure:

Procedure

Step 1   In the Choose the Exception from the List box, select the exception that will trigger the execution of the On Exception Goto step.

Step 2   From the Choose the Label from the List drop-down menu, choose the label to which the script will branch when the exception occurs.

Step 3   From the Save Root Cause (Optional) drop-down menu, choose an exception object, if desired.

Step 4   Click OK.

The On Exception Goto customizer window closes, and the information you entered appears next to the On Exception Goto step icon in the Design pane of the CRA Editor.





Set

Use the Set step to change the value of a variable.

The Set step supports type casting (with possible loss of precision) from any Number data type (Integer, Float, Long, Double, BigInteger, BigDecimal) to any other Number data type.

You can also use the Set step to convert a String variable to any Number data type. For String conversions, the system replaces all "*" characters with a decimal point (".") before performing the conversion.

Figure 1-17 shows the customizer window for the Set step.


Figure 1-17   Set Customizer Window


Table 1-7 describes the properties of the Set customizer window.

Table 1-7   Set Properties

Property Description

Variable

Variable for which the value will be set.

Type

Display only. Variable type.

Assign

Value for the specified variable.

To use the Set customizer window to set the value for a variable, perform the following procedure:

Procedure

Step 1   From the Variable drop-down menu, choose the variable for which the value will be set.

The Type field automatically displays the type of the variable you chose in the Variable drop-down menu.

Step 2   From the Assign drop-down menu, choose the value for the specified variable, or click the Expression Editor (...) button to enter any valid expression.

Step 3   Click OK.

The Set customizer window closes, and the information you entered appears next to the Set step icon in the Design pane of the CRA Editor.





Start

The CRA Editor automatically adds the Start step when you create a new script by choosing File > New.

This step has no properties and does not require a customizer. It is not shown in any palette.

Switch

Use the Switch step to cause the program logic to branch to one of a number of cases based on the evaluation of a specified expression.

A case is a method for providing script logic based on the value of a variable at a point in time. You can assign one case for each value. The Switch step lets you define any number of case output branches. You can then create a separate script logic for each branch.

The Switch step supports switching based on the following variables:

  • Integer—Comparison of integers
  • String—Comparison of string variables (case insensitive)
  • Language—Comparison of language variables

Note    The language comparison will attempt the parent language before falling back to default. For example, a match for L[en_US_Judy] will first attempt to match from the following list: {L[en_US_Judy], L[en_US], L[en]}, and then return "Default" if no item in the list matched.

The type of switching is automatically determined by the type of the specified expression.

Steps that you add following a specific case output branch execute if the integer, string, or language expression you specify for that case is equal to the global expression defined in the Switch Expression field.

The Default branch of the step allows you to handle cases where none of the branches matches the expression.

Figure 1-18 shows the customizer window for the Switch step.


Figure 1-18   Switch Customizer Window


Table 1-8 describes the properties of the Switch customizer window.

Table 1-8   Switch Properties

Property Description

Switch Expression

Expression to be executed.

Switch Case(s)

  • Case—Output branch containing script logic specific to one possible variable value.
  • Label—Target to which the script branches when the variable equals a specific value.

To use the Switch customizer window to create script logic for a case, perform the following procedure for as many cases as desired.

Procedure

Step 1   From the Switch Expression drop-down menu, select a variable or expression, or click the Expression Editor (...) button to enter any valid expression.

Step 2   Click Add.

The Switch Case and Label dialog box appears. (See Figure 1-19.)


Figure 1-19   Switch Case and Label Dialog Box


Step 3   In the Language Case field, enter a value.

Step 4   In the Output Label Name field, enter an output label name.

The script will branch to this Label when the variable equals the value specified in the Language Case field.

Step 5   Click OK.

The Switch Case and Label dialog box closes.

Step 6   Click OK.

The Switch customizer window closes, and the information you entered appears next to the Switch step icon in the Design pane of the CRA Editor.





Time of Day

Use the Time of Day step to cause the script to branch to different connection branches depending on the current time of day.

Steps that you add following a specific output branch will execute if the CRA Engine clock indicates that the time of day matches the time associated with that connection.

You associate each output branch with a specified range of time.

During run time, if the current time falls out of the configured time range, the script follows the Rest output branch of the Time of Day step.


Note   When you debug this step on a remote workstation, make sure that the workstation is set to the same time zone as the CRA server on which this script will run. If you change the time zone on a workstation while the CRA Editor is running, you must close the CRA Editor and restart it for the time-zone change to take effect.

Figure 1-20 shows the customizer window for the Time of Day step.


Figure 1-20   Time of Day Customizer Window


Table 1-9 describes the properties of the Time of Day customizer window.

Table 1-9   Time of Day Properties

Property Description

Connections

Output branches that execute depending on specified time of day

Time Ranges

Time ranges for each connection branch

To use the Time of Day customizer window to add a new connection and specify a range of hours for that connection, perform the following procedure.

Procedure

Step 1   Click Add.

The Add Connection Name dialog box appears. (See Figure 1-21 .)


Figure 1-21   Add Connection Name Dialog Box


Step 2   In the Connection Name field, enter the new connection name, and then click OK.

The Add Connection dialog box closes, and the name of the new connection appears in the Connections text box of the Day of Week customizer window.

Step 3   To specify a range of hours, select the connection in the Connections text box, and then click Add Time.

The Add Range of Hours dialog box appears. (See Figure 1-22 .)


Figure 1-22   Add Range of Hours Dialog Box


Step 4   From the Start Time list, choose a start time.

Step 5   From the End Time list, select an end time.

Step 6   Click OK.

The Add Range of Hours dialog box closes.

Step 7   Click OK.

The Time of Day customizer window closes.