cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
459
Views
0
Helpful
2
Replies

How to use VEvent and VAction classes in Custom Voice Elements

sreekanth47
Enthusiast
Enthusiast

Hi Experts,

                I'm unable to to handle NoInput and NoMatch events using VFC. I'm getting undefined for both events when VField throws noinput or nomatch . I'm having hard time with this. Can any one explains me how these two classes are working, I read java doc for VAction and VEvent classes but I'm not quite sure about these classes.

2 Replies 2

ewindgat
Contributor
Contributor

Could you share an example of your code?

Are you performing something like this...

VAction exit = VAction.getNew(pref, VAction.EXIT );

thanks ewindgat,

           I'm throwing  a nomatch like below.

// this action sets the menu field to undefined and throws a no match.

  VAction throwNomatch = VAction.getNew(pref, VAction.ASSIGN, vFName, "maxError", VAction.WITHOUT_QUOTES);

  throwNomatch.add(VAction.THROW, VAction.NOMATCH); . But vFName will always override with value "undefined".

handling nomatch event

NoMatchPrompt nomatch = new NoMatchPrompt(ved, NoMatchAudioGroup,"max_nomatch_count", getSubmitURL(), 1);

  menufield.add(nomatch.getEvent());.

Now I'm able to catch NoMatch/NoInput event by using reqParameter off HashTable which is supplied as method parameter for addXmlBody(*****). I'm getting a string value "Yes" If an noMatch/NoInput occures. the below is the sample code I'm using now.

String NoMatch = (String)reqParameters.get( "maxNoMatch" );

        String NoInput = (String)reqParameters.get( "maxNoInput" );

         boolean isErrorCondition = false;

         if( NoMatch != null ){

          logger.debug("[processMenu] NoMatch condition");

          if( ((String)NoMatch).equals("yes") )

          {

          //It's a nomatch

          }

         } else if ( NoInput != null ) {

          logger.debug("[processMenu] NoInput condition");

          if( ((String)NoInput).equals("yes") )

          {

         it's a noinput

          }       

         }

thank you

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:

Recognize Your Peers