Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
Can the Form element be extended to incriment a session variable before enabling error handling?
Reason being is I want to keep track of the number of errors a caller has encountered through the application.
I then want to be able to intercept the form execution when this count reaches a certain point, and either execute something - or skip to another part of code.
Is this possible? Can I modify the form element enough to change thsi behaviour?
Cheers
Bernie
Subject: RE: Extending Voice Element - Session Data incrementation Replied by: Vance Vagell on 13-05-2005 03:33:32 PM Hi Bernard,
Could you please clarify which type of errors you would like to keep track of?
If you mean events such as nomatch and noinput, you can certainly extend the form element to do what you need. You can see examples of how to extend form elements in this post from our Developer Resources Section. I recommend looking at "New Digit With Confirm" and "Extended Element Example". "New Digit With confirm" shows you how to create an element by extending an existing Audium element and modifying the exit states returned (for example, to add counters).
However, if you mean Java runtime errors and unhandled exceptions, these can be handled by an error element.
Hope this helps, Vance
Subject: RE: Extending Voice Element - Session Data incrementation Replied by: null on 17-05-2005 02:07:33 AM Hi Vance,
Thanks for that posting. The "New Digit With confirm" was certainly insightful in how we can manipulate the Form element into creating a "super element", and hence dealing with error states there, but I don't think that is exactly what I"m after.
I want to keep a counter of the number of times a person as made an error in the entire application. This number will need to be incremented whenever a person provides a no-input, or no-match... regardless of if they maxed out or not.
I can see the changes to exitState in this element, but this exitState is for the max existStates, and does not deal with the internal to element error count... (does that make sense?).
I want to be able to calculate ALL the errors that have occured, not just the ones that cause a Max exit state.
Cheers
Bernard
Subject: RE: Extending Voice Element - Session Data incrementation Replied by: Michael Bochynski on 18-05-2005 04:21:48 PM Hi Bernard,
You can catch, and deal with, each single occurrence of an event in this super-element. The sample code shows manipulation with exitStates, however the same logic applies to NoMatch and NoInputs events. You could add your own event handling and increment the session/element value every time any NoMatch/NoInput event is thrown.
Hope this helps, Michael
Subject: RE: Extending Voice Element - Session Data incrementation Replied by: null on 19-05-2005 07:03:15 AM Hi Michael,
Thanks for that. I've taken a good hard look at this, and I honestly can't see where or how I would go about catching tehse events. I can see how we capture the exist state (returned = result.getExitState();), and modify the way the super-element are called, but I honestly can't see how I get into the element itself to catch the events (NoMatch NoInput) themselves.
Could you give me a lead on how to do this? I've tried searching through the Java Documents, but I can't see a function call or return that would allow me to break into the internal workings of an element.
The closest thing I can find is to access these events through the VEvents instead of through audium sub-elements. The issue is the use of VEvents entails extending the VFC's to generate VXML code and hence bypasses all the pre-build audium element functions...
I guess I need guidance as to the best way of accessing these events. Is it to some how break into the Audium elements as subelements, or is the only way to control events through the use of VForms and hence VEvents??
Cheers
Bernard
Subject: RE: Extending Voice Element - Session Data incrementation Replied by: null on 19-05-2005 10:21:15 AM Oops... please ignore my last comments. Written in haste and I should firstly READ THE MANUAL 🙂
Ok, so I've set up my element but it doesn't do anything other then set up parameters that can be used. Can I now assume that I now have to build the logic of how the element works using the VFC's? Ie. I can not actually re-use any of the Form element defined features because I've basically designed a new Form element?
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: