cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
53
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: null on 19-01-2004 06:08:16 PM
Would it be possible to provide an example of how one would create a custom element that encapsulates a VoiceXML Object element.

I've attached a sample that uses the Object element in question:

<?xml version="1.0"?>

<vxml version="2.0">

<form id="infoStore">

<object name="infoStoreObj" classid="builtin:INFOSTORE.InfoStore">

<param name="FILE_NAME" expr="'C://Program Files//Vista//server//services//myVoiceXML//Tst//appconfig.SynInf'" />

<param name="SUB_KEY1" expr="'InitializerConfigurations'" />

<param name="SUB_KEY2" expr="'EmptyInitializer'" />

<param name="BOOL_ITEM" expr="'BoolTst'" />

<param name="DOUBLE_ITEM" expr="'DoubleTst'" />

<param name="FLOAT_ITEM" expr="'FloatTst'" />

<param name="INTEGER_ITEM1" expr="'ConfigType'" />

<param name="INTEGER_ITEM2" expr="'ClassLoaderType'" />

<param name="STRING_ITEM1" expr="'ClassName'" />

<param name="STRING_ITEM2" expr="'ClassPaths'" />

</object>


<catch event="com.syntellect.exception">

<log expr="'XXXX VXML InfoStore: ' + _message"/>

<exit/>

</catch>

</form>

</vxml>


Thanks.

Subject: RE: Object element customer element example
Replied by: null on 20-01-2004 03:16:30 PM
Hi,

In order to make a voice element, one must use the Voice Foundation Classes (VFCs) to produce the VoiceXML desired.

To produce the <object> tag, use the VObject VFC. This is simply just a form item, so one must create a <form> to encapsulate the object. use a VForm object to do this. The VObject VFC has methods named "addParam" in it that allows you to define all the parameters to the object.

In your example, you have a catch statement for a custom event. To do this, simply use the VEvent VFC with the getNew method that allows you to pass the name of the event it captures. So in this example, you would create a new VEvent by doing the following:

[code:1:31c9c67e69]
VEvent myCustomEvent = VEvent.getNew&#40;preference, "com.syntellect.exception"&#41;;
[/code:1:31c9c67e69]

You can the define the content of the event by creating a VAction that encapsulates the <log> and <exit> tags. Add that VAction to the VEvent, add the VEvent and the VObject to the VForm, add the VForm to the VMain object passed to the execution method of the voice element, and you are all set.

For more information on the VFCs, please refer to the Javadocs and the Programmer Guide. Also, another place to look would be the Audium 3.3 Developer Resources forum on Audium Central. There, you will find sample code; DualAudioVoiceElement.java is a good example of a voice element. To see examples of how the VFCs are used, refer to the quick references which give examples that show almost all VFC classes being used in the document labeled "VFC Examples.pdf".

Hope this helps!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links