Lesson 11 – Processing Conditions

Objectives

Lesson 11 introduces the use of conditions in order to influence the dialog behavior. Moreover it simulates a transfer to an agent by the use of an Exit object. After completing this lesson you will know

·          what is basically meant by conditions in VoiceObjects,

·          how to create an Exit object,

·          how to create a Silence object,

·          how to branch the dialog flow with an If object.

Conditional Processing

Depending on parameters such as user input, user profile, external data, date, time, etc. parts of a dialog flow may or may not be processed.

If objects and Case objects can be used, to make parts of a dialog flow dependent on certain conditions. An If object is used to split a dialog flow into two subtrees depending on a condition evaluated at call time. A Case object is used to split the dialog flow into multiple subtrees depending on one or more conditions evaluated at call time. For further details refer to If and Case in the Object Reference.

In addition, preconditions can be used to express certain dialog conditions and influence the dialog behavior. A precondition is a condition that is evaluated at call time before processing an object. The object is only processed if the condition evaluates to true. For more information about preconditions see Pre- and Postprocessing in the Object Reference.

In the Dialog Designer, objects with a precondition are indicated with a Precondition icon .

In the case of the Life Insurance application an If object will be used to influence the dialog flow depending on the caller wishing to be transferred to an agent or not.

Asking for Agent Transfer

After calculating the life insurance fee through the Script object in the previous lesson, the next dialog step in the Life Insurance application is to offer the caller to speak to an agent. This is realized by another Input object, which is possibly followed by an agent transfer and therefore embedded in a Sequence object.

1.        Add a Sequence object to the embedded sequence of the Life Insurance Module object in the respective Module editor or in the Dialog Designer (see the previous lesson how to do this).

2.        In the Sequence editor, enter Offer option to connect to an agent as the name for the new Sequence object.

3.        In the Object Sequence section of the Sequence editor, click the Context Menu button   to the right of the Object field and add a new Input object.

4.        In the Input editor, enter Speak to an agent now? as the name for the new Input object.

5.        Enter Would you like to speak to an agent now? in the text area of the embedded output in the Input Request section.


 

6.        In the Grammar section, enter yes, no in the text field to specify a classical Yes/No grammar.


 

7.        In the Result Handling section add a new Variable object called Yes/No answer to the Variable field and enter sltTTG in the Slot field.


 

8.        Leave all other values as default.

9.        On the toolbar of the Input editor click Save and Close and find the Input object added to the object sequence of the Offer option to connect to an agent Sequence object.

Specifying an Exit Object

Next, you will create an Exit object in order to simulate the transfer to an agent, which will be added to the dialog flow later on. Transferring a call is actually done by a Transfer object but due to its technical complexity will be simulated by an Exit object for demonstration purposes here. For further information on real transfers refer Transfer in the Object Reference.

To create the Exit object for the Life Insurance application, do the following:

1.        From the New menu, select Exit. An empty Exit editor will open up.



2.        In the Exit editor, enter Simulate agent transfer as the name for the new Exit object.

3.        In the Goodbye Message section, enter something like Hi! My name is Ray MacArthur. I understand you're interested in life insurance. How can I help you? in the text field.

4.        Click the Context Menu button   to the right of the text field and create a new Silence object via the context menu.

5.        In the Silence editor, enter Very long pause as the name for the new Silence object.

6.        In the Silence Duration section, select 60 Seconds from the drop-down list in the Duration field.



7.        On the toolbar of the Silence editor click Save and Close to add the Silence object.
For further information in the Silence Object refer to Silence in the Object Reference.


The Goodbye Message section of the Exit object looks like this now:


 

8.        In the Processing section of the Exit editor select Disconnect from the drop-down list in the Dialog exit type field in order to disconnect the call after processing the Exit object.


 

On the toolbar of the Exit editor click Save and Close. The Exit object will be added to the dialog flow in the next step.

For detailed information on the Exit object refer to Exit in the Object Reference.

Branching the Dialog Flow

Next, you will add an If object to the Sequence object in order to split the dialog flow depending on the caller input given in the Speak to an agent now? Input object.

1.        Add a new row to the Object Sequence section of the Offer option to connect to an agent Sequence object by clicking the Add button  on its toolbar.

2.        Click the Context Menu button to the right of the Object field and create a new If object via the context menu.



1.        In the If editor, enter Check if caller wants agent transfer as the name for the new If object.

In the IF section of the If editor you specify the condition that needs to be met in order to process the THEN section (i.e. the caller said yes when being asked for an agent transfer).

2.        In the IF section, select the equal function “=” from the drop-down list in the Function field to check if argument [1] equals argument [2].

3.        In the Arg. [1] field, add the Yes/no answer Variable object by browsing.

4.        In the Arg. [2] field, enter yes.

The IF section looks like this now:


 

5.        In the THEN section, add the Simulate agent transfer Exit object created previously into the Object field by browsing for it via the Context Menu button .


 

6.        On the toolbar of the If editor click Save and Close to add the If object to the object sequence of the Offer option to connect to an agent Sequence object.

For further information on the If object refer to If in the Object Reference.

The Offer option to connect to an agent Sequence object looks like this now:



Finally, on the toolbar of the Sequence editor click Save and Close.


The dialog flow for the Life Insurance Module object looks like this now:


Dialog Flow 10

You have now added a Sequence object to the Life Insurance application, which contains two objects. The first one is an Input object that asks the caller if he/she wants to be transferred to an agent. The second object is an If object that, depending on the answer of the caller to the previous question, either processes an Exit object that simulates an agent transfer or returns to the Module object.

After redeploying your service in the Control Center, call it and test the application behavior.

The following dialog flow shows an example dialog for the Prime Life Insurance service you have created so far:


Object – Caller

Dialog Flow

Good morning and welcome to the Prime Life Insurance service!

To help me calculate what your monthly premium would be for life insurance, please say if you are male or female.


Caller

Female.

Now please say your age.


Caller

Twenty-eight.

Ok, I have recognized your gender as female and your age as twenty-eight. Is that correct?


Caller

Yes.

The monthly premium for a twenty-eight year old female is 27 dollars.

Would you like to speak to an agent now?


Caller

Yes.

*

<…Check caller input…>[ yes ]

Hi! My name is Ray MacArthur. I understand you're interested in life insurance. How can I help you?
 [ Silence of 60 second ]
< Disconnect the call >

What Comes Next

Next, you will add some additional features to the Life Insurance application that improve the design of the application with respect to its usability and its hear and feel.

Lesson 12 – Designing User-Friendly Applications