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

Created by: null on 16-11-2006 12:05:44 PM
Hi,
I am trying to build a custom element. I have been using 2 of the examples as a basis for this work - ExtendedElementExample.java and NewDigitWithConfirm.java. The problem that I have bumped into is that when generating a second VoiceXML page to do a second part of the element the page is not generated. ( The first page is generated and operates correctly) This is also the case if I use the NewDigitWithConfirm element unmodified apart from adding some logging so that I can see where it is going wrong.

Is this example missing something or is there some other problem.
Thanks
Julian

Subject: RE: Building custom elements
Replied by: Michael Bochynski on 20-11-2006 06:20:47 PM
Hi Julian,

We have tested the posted sample code and it should work fine. How do you test the elements? Do you use a web browser or a voice browser? Are there any errors in Audium when you call into this element?

Michael

Subject: RE: Building custom elements
Replied by: null on 21-11-2006 09:53:03 AM
Hi Michael,
The voice elements are tested using the HTK voice browser. I have attached the Audium logs and the java code that is generating it. As you can see there is an error generated when returning from addXmlBody() after having attempted to generate the second Vxml page. The exit state returned by the call to generate the vxml page is a blank string and the vxml is not generated. If either a blank string or a substituted null is returned from addXmlBody() then the audium error is generated - see logs.

Thanks
Julian

Subject: RE: Building custom elements
Replied by: Vance Vagell on 27-11-2006 07:32:02 PM
Hi Julian,

We have been able to replicate the issue you are seeing with the NewDigitWithConfirm sample element. While we do test each of our samples before releasing them to end-users, it is possible that this element was tested on an earlier version of Call Services on which it functioned as expected.

That said, we have isolated the cause of the issue so that your project can move forward. The problem stems from the fact that during the second iteration of the voice element (e.g. when it is about to produce the second VoiceXML page), stale scratch data is present that prevents normal functioning of the element. The scratch data can be cleared with a call to ved.removeAllScratchData(), as is later done (but not in time). However, some scratch data may be important to the functioning of this element, and so care must be taken to ensure that important data is preserved while clearing out the unwanted data.

For a detailed explanation of why the scratch data must be cleared, please refer to the source code comment that starts "We now must go back to the digit entry."

Thank you for bringing this issue with some of our sample code to our attention. While sample code is a great way to learn the structure of more complex API usages, we recommend that you perform rigorous testing of any custom elements you develop that are derived from such code. We provide our sample code AS IS for learning purposes, and encourage you to experiment and learn from it, but please take precautions when using it as part of a production application.

Regards,
Vance

Subject: RE: Building custom elements
Replied by: null on 28-11-2006 02:17:51 PM
Hi Vance,
I have tried your suggestion of clearing the scratch data. But this made no difference. I also tried not using scratch data at all but used session data instead. This also behaved in exactly the same way ie when attempting to generate the 2nd vxml page no page is generated. The logs are exactly as before. So it would appear that the scratch data is not the issue?
Did this example code work in your system with scratch data cleared?
Thanks
Julian

Subject: RE: Building custom elements
Replied by: Vance Vagell on 06-12-2006 08:03:35 PM
Hi Julian,

Our initial look at this issue indicated that the way that scratch data is cleared (and/or not cleared) each time the element is visited is what is causing the problem. That said, a more thorough examination and testing would need to be performed in order for more specific recommendations to be given. When we release the next version of this sample source code, we will keep the issue you have reported in mind.

That said, we generally discourage the use of "super elements" (as is noted throughout the comments in that sample source file) due to the complexity of their implementation, as well as the difficulty of understanding the requirements of each sub-element. For example, clearing the scratch data could wipe out important variables that a sub-element needs, and you have no way of easily knowing about that requirement.

Therefore, it is generally preferable to approach this problem in one of two ways:

  • Use the new Element Groups functionality (as of Studio 5.x) to string one or more elements together in a pre-configured way. You can even right-click on an Element Group and save it for easy reuse via Studio's Elements view. For detailed information about how to use Element Groups, please refer to this Audium Knowledge Base article.

  • If Element Groups don't provide the full functionality you require, we recommend you create a custom voice element from scratch rather than calling existing elements as sub-elements. This allows you full control (and insight into) the requirements and functionality of the super-element.

Regards,
Vance
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