Cisco Cisco Customer Voice Portal 8.0(1) Developer's Guide

Page of 122
This chapter contains the following topics:
Design
Configurable elements are built by extending an abstract Java class. This base class lays out the
methods used to identify the element’s configuration, how it is executed, and any utility methods
available to it. The developer simply implements the appropriate methods and uses the Java
API provided to build the element. Within the execution method, the developer is then free to
use Java in any way possible, such as creating a complex class hierarchy, accessing files or
backend systems, utilizing third party libraries, even communicating with external systems via
HTTP or RMI.
Voice elements must extend 
VoiceElementBase
, action elements extend
ActionElementBase
, and decision elements extend 
DecisionElementBase
, all found in
the 
com.audium.server.voiceElement
 package. These three base classes all extend a
common base class for configurable elements, 
ElementBase
.
In order for Builder for Call Studio to identify the Java class representing the actual element
(as opposed to another class lower in the class hierarchy or a standard element that also extends
that class), a marker Java interface named 
ElementInterface
 must be implemented. Only
those classes that implement this interface are shown in the Builder’s Element Pane.
Each configurable element contains a single execution method in which the element performs
its function. This method is called by VXML Server when that element is visited in the call
flow. One can equate this method to the element’s 
main()
 method, it begins and ends there.
One argument to the method is an instance of a Session API class. Aside from the standard
functionality available in this class such as obtaining the ANI and setting element data, this API
class can be used to obtain a Java object representing the element’s configuration. VXML Server
automatically creates this configuration object with the data entered by the application developer
in the Builder or made available through a dynamic configuration. The name of the execution
method and the API class passed to it differ for each element type as do the classes encapsulating
the element’s configuration. The execution method for decision and voice elements must return
an exit state and the execution method for action elements do not return anything (since all
action elements explicitly have a single exit state).
The execution method for action and decision elements can throw an 
AudiumException
 while
voice elements can throw an 
ElementException
. The developer would throw this exception
if an error was encountered within the execution method that the developer wishes to end the
call. A call that encountered this exception would then visit the error element (or the
application-specific error message if the error element was not defined), and the error message
is placed in the error log including the exception’s full stack trace.
Programming Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 8.0(1)
54
Chapter 9: Configurable Elements
Design