Cisco Unity Express 1.1.1 Script Editor Guide
General Step Descriptions

Table Of Contents

General Step Descriptions

Annotate

Call Subflow

General Tab

Parameter Mapping Tab

Day of Week

Decrement

Delay

End

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 Unity Express Script Editor provide basic programming functionality for scripting.

The General palette contains the following steps:

Annotate

Call Subflow

Day of Week

Decrement

Delay

End

Goto

If

Increment

Label

On Exception Clear

On Exception Goto

Set

Start

Switch

Time of Day

Figure 37 shows the steps in the General palette as they appear in the Palette pane of the Cisco Unity Express Script Editor.

Figure 37 General Palette Steps

Annotate

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

Figure 38 shows the customizer window for the Annotate step.

Figure 38 Annotate Customizer Window

To annotate a script, enter your comments in the Enter Comments field and 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 Cisco Unity Express Script 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.

Use the Cisco Unity Express Script Editor to create the subflow as an independent script that you can reuse in other scripts. Subflows can be nested; that is, you can call subflows from within scripts that are themselves used as subflows.

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:

General Tab

Parameter Mapping Tab

General Tab

Use the General tab of the Call Subflow customizer window, shown in Figure 39, to specify the filename of the subflow you want to call.

Figure 39 Call Subflow Customizer Window—General Tab

Table 11 describes the fields of the General tab.

Table 11 Call Subflow Fields—General Tab

Field
Description

Subflow Name

Filename of the subflow you want to call.

Disable Interruptions

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


Follow these steps to use the General tab of the Call Subflow customizer window to call a subflow:


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 filename 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.

Step 5 See "Parameter Mapping Tab" to configure the subflow parameters.


Parameter Mapping Tab

Use the Parameter Mapping tab of the Call Subflow customizer window, shown in Figure 40, 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 such as "counter + 3".

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

Figure 40 Call Subflow Customizer Window—Parameter Mapping Tab

Table 12 describes the fields of the Parameter Mapping tab.

Table 12 Call Subflow Fields—Parameter Mapping Tab

Field
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.


Follow these steps to map variables or expressions:


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, as shown in Figure 41.

Figure 41 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. The name and type of the variable you entered 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. The script name you specified in the General tab appears next to the Call Subflow step icon in the Design pane of the Cisco Unity Express Script Editor.


Day of Week

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

When the Cisco Unity Express system clock matches one of the days associated with a connection, the script executes any steps that you configured for that day's connection branch.

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

Figure 42 shows the customizer window for the Day of Week step.

Figure 42 Day of Week Customizer Window

Table 13 describes the fields of the Day of Week customizer window.

Table 13 Day of Week Customizer Window Fields

Field
Description

Connections

Output branches that execute depending on a specified day of week.

Days

Days of the week for each connection branch.


Follow these steps to add a connection output branch and associate it with days of the week:


Step 1 Click Add.

The Add Connection Name dialog box appears. (See Figure 43.)

Figure 43 Add Connection Name Dialog Box

Step 2 In the Connector Name text field, enter a name for the connection branch and 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.


Note 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 field 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 44 shows the customizer window for the Decrement step.

Figure 44 Decrement Customizer Window

To decrease the chosen Integer variable by one, choose the desired variable from the Variable drop-down menu and click OK.

The Decrement customizer window closes. The variable appears next to the Decrement step icon in the Design pane of the Cisco Unity Express Script Editor.

Delay

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

Figure 45 shows the customizer window for the Delay step.

Figure 45 Delay Customizer Window

Table 14 describes the fields of the Delay customizer window.

Table 14 Delay Customizer Window Fields

Field
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.


Follow these steps to specify a script processing delay:


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 To allow external events to interrupt the delay, click the Yes radio button.

Step 3 Click OK.

The Delay customizer window closes. Either the number of seconds or the name of the variable appears next to the Delay step of the Design pane of the Cisco Unity Express Script 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 call 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.

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 46 shows the customizer window for the Goto step.

Figure 46 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 click OK.

The Goto customizer window closes. The label name appears next to the Goto step icon in the Design pane of the Cisco Unity Express Script 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 47 shows the customizer window for the If step.

Figure 47 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 click OK.

The If customizer window closes. The expression appears next to the If step icon in the Design pane of the Cisco Unity Express Script 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 48 shows the customizer window for the Increment step.

Figure 48 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 click OK.

The Increment customizer window closes. The variable appears next to the Increment step icon in the Design pane of the Cisco Unity Express Script 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 49 shows the customizer window for the Label step.

Figure 49 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. The Label name appears next to the Label step icon in the Design pane of the Cisco Unity Express Script 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. The Label step is configured with a script 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 50 shows the customizer window for the On Exception Clear step.

Figure 50 On Exception Clear Customizer Window

To clear an exception, select the specific exception from the list box and click OK.

The On Exception Clear customizer window closes. The exception being cleared appears next to the On Exception Clear step icon in the Design pane of the Cisco Unity Express Script 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 51 shows the customizer window for the On Exception Goto step.

Figure 51 On Exception Goto Customizer Window

Table 15 describes the fields of the On Exception Goto customizer window.

Table 15 On Exception Goto Fields

Field
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.


Follow these steps to create a response to an exception:


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. The information you selected appears next to the On Exception Goto step icon in the Design pane of the Cisco Unity Express Script 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 52 shows the customizer window for the Set step.

Figure 52 Set Customizer Window

Table 16 describes the fields of the Set customizer window.

Table 16 Set Customizer Window Fields 

Field
Description

Variable

Variable for which the value will be set.

Type

Variable type. The application software assigns this value.

Assign

Value for the specified variable.


Follow these steps to set the value for a variable:


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.

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. The information you entered appears next to the Set step icon in the Design pane of the Cisco Unity Express Script Editor.


Start

The Cisco Unity Express Script 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).

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

If the integer or string expression you specify for a case is equal to the global expression defined in the Switch Expression field, the script executes the steps configured for that case output branch.

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

Figure 53 shows the customizer window for the Switch step.

Figure 53 Switch Customizer Window

Table 17 describes the fields of the Switch customizer window.

Table 17 Switch Customizer Window Fields 

Field
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.


Follow these steps to create script logic for one or more cases:


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, as shown in Figure 54.

Figure 54 Switch Case and Label Dialog Box

Step 3 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 Case field.

Step 4 Click OK.

The Switch Case and Label dialog box closes.

Step 5 Click OK.

The Switch customizer window closes. The information you entered appears next to the Switch step icon in the Design pane of the Cisco Unity Express Script 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.

When the Cisco Unity Express system clock indicates that the time of day matches the time associated with a connection, the script executes any steps configured for that output branch.

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.

Figure 55 shows the customizer window for the Time of Day step.

Figure 55 Time of Day Customizer Window

Table 18 describes the fields of the Time of Day customizer window.

Table 18 Time of Day Customer Window Fields

Field
Description

Connections

Output branches that execute depending on specified time of day

Time Ranges

Time ranges for each connection branch


Follow these steps to add a new connection and specify a range of hours for that connection:


Step 1 Click Add.

The Add Connection Name dialog box appears as shown in Figure 56.

Figure 56 Add Connection Name Dialog Box

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

The Add Connection dialog box closes. 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 click Add Time.

The Add Range of Hours dialog box appears as shown in See Figure 57.

Figure 57 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.