02-26-2015 07:38 AM
Hello,
Is it possible to throw custom Hotevent from Java code?
My intention is to throw this custom event from Java file when back-end integration error like WebService timeout etc.
So how to i archive this? Do you have a code example?
What i research is
1. Implement HoteventInterface but what should i put there so i can create "error.mycustom" event that catch-able in HotEvent element.
2. Throw Hotevent from Java code. How to archive this i have no idea at all.
Thanks guy.
02-26-2015 10:38 AM
To throw a custom event you'd have to create a custom voice element and use the VAction class to add the <throw> tag. If you want to trap server-side processing events then making use of the version 10.5 event handling enhancements would probably be a better (and far simpler) way to go.
Paul
02-26-2015 04:02 PM
Paul,
Do you know how to enter multiple java exceptions (or vxml events)? Are
they comma separated?
02-26-2015 05:38 PM
You're referring to the event list on the element config event tab? If so, it's comma separated.
02-26-2015 06:55 PM
Hello Paul,
I don't have 10.5 to try yet. Currently i'm working on V9. Is it corrent that it is no possible to throw HotEvent from ActionElement?
And do you have any code example to add the custom event to the root document?
02-27-2015 02:48 AM
HotEvent's relate to VoiceXML events so I don't understand why you'd want to get involved with throwing custom VoiceXML events based on server-side exceptions. Maybe I misunderstood your use case.
I'm assuming you're trying to handle a server-side event resulting from some back-end processing so I would simply use a custom Decision Element, catch the Java exception(s) of interest and return via an error exit state. Then, perform whatever caller dialogue actions, retries, alternative integration actions etc as appropriate to the error.
Paul
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide