Current I have a CustomDateWithConfirm class which is extend to MBasicDateWithConfirm, to valid the date such as "19900231", the way currently I did is once I get this value, I increment the disconfirmed count, then ask the user to re-enter the date again. The way I want is if user the invalid date, such as 19900231, I need the way to let CVP know it is Date NoMatch state, and ask user to re-enter again, how can I do this?
By the way I using CVP 10.5
In Studio 11.0 there's a utility you can use in the SetValue element to
check if a date is valid.
If you're not on CVP11, then why not just change from Date with Confirm
to a Date element, followed by either the SetValue (11.0) or a and a a
custom java element to check if the date is valid.
If it is valid, use a YesNoMenu to confirm the date with the caller.
If not valid, tell the caller it's not valid, and perhaps increment a
counter, and then either re-collect the Date or transfer to agent.
That is my original thought...
But the problem is if I have another project(s) need the same element, each time I need to add 5 elements, counter, decision, date, audio(for confirm) and yesNoMenu. It seems like not really efficient... That is why I want to write one custome element that once I got invalid date, it increase the nomatch count.
Or is it have better way to make that 5 elements into one??
If you're writing your own element, it'll definitely be more efficient.
If you're already testing if the date is not valid in your custom
element, then why not just have your tag throw a NoMatch event?
Your custom element should be catching that event already.
Cisco Designated VIP
Training the Experts, LLC
Expert Training in CVP, IVR, VoiceXML, and Speech Technologies
1 Roundys Hill, Marblehead, MA 01945
How to tag the nomatch event? Automatically? Seems like not that case
create a tag
If it's more the cumbersome nature and untidiness aspect of having to insert the same 5 elements everywhere that's the problem, have you tried making them into an element group? It doesn't fit all situations but it can make things look somewhat neater and more manageable without having to code new elements.
Can you give me an example how to make the element group? Or just like subflow?
Select the elements you want to group.
Right-click on the selection and click on Group Elements.
The selected elements will be reduced to a single one.
You can double click on it to expand it and open the group.
You can also save the group into a pallette folder of your choice for reuse (right click and select Save As).
Let me know if you hit a snag with these steps.
I just think about that again, if I group the element, it might mess up the nomatch count.
For example, if the max_nomatch is 3, then following situation might be the problem.
User enter "19920231", that is invalid date, should recognized as no match (1st time)
User enter something else again such as "1990020"(CVP can handle that before my validation runs), count as no match 2
and User probably re-enter the date again with one of following above, that should count as no match 3.
Then the program provide following action for max_nomatch.
So I don't know what is the better way to accomplish this...
Grouping shouldn't change the functionality; it's essentially just a way of inserting a copy of a bunch of elements with the interconnection between them hidden.
I know the group will not change the functionality, I just don't know how to handle that case I mentioned above. If I group into one element, I just want the exit_state is done, max_noinput, max_nomatch, and max_disconfirm.
The element group can have the same exit states as the elements
contained in the group. Or you can easily use a Subflow for this.
What version of CVP/Studio do you have?
We are using 10.5
In VoiceXML, if you throw a nomatch event, then it'll go to your nomatch
So, in your filled tag, if you determine that the date isn't valid, then
use a VAction to throw a nomatch event.
Can you give me an code snippet for using VAction to throw nomatch event?
So seems like no way to do in Java code?
I don't really understand what you're looking for.
You said that you'd created your own DateWithConfirm element, so you must know how to write a voice element using java and the java classes that create the associated vxml tags. So, all you need to do is within the <filled> tag, use a VAction to throw an noinput event. I've never done this using Java, so no, I can't give you the java to do this.
Personally, I wouldn't use the DateWithConfirm.
I would use a Digits element to ask the caller to enter an 8-digit date.
If not valid, I'd increment a counter, check the counter, and if it's less than some value (like 3), I'd tell the caller they entered an invalid date, and loop back to re-collect.
If it's valid, then I'd connect to a YesNoMenu to confirm.
While it's more steps in Studio, it's easy to follow and easy to maintain.
OK, let us bring the question simple.
For all the element(let's say the simplest one, digit) that already implement by call studio, how do they know the input that given by user is no match? I am reading the source code for that, but I can't find any code related information in the source. If I know where the code handle this, that simply answer the original questions..
When you use the Digits element in Studio, you configure the MinDigits
and MaxDigits allowed under Settings.
If the caller enters anything less than the MinDigits, or if the caller
enters the DTMF * key (which is not a 'digit') then the system throws a
NoMatch event. And then based upon the Setting named MaxNoMatch - it'll
either reprompt the caller or return to VXML Server to continue down the
max_nomatch exit state.
Most of the Studio elements that collect input, are loading up a
built-in grammar on the gateway. The allowable inputs for each element
corresponds to the allowable input for the associated grammars (Digits,
Number, Currency, Date, Time, Phone).
You can look in the CVP Documentation at the Element Specifications
reference manual, it should tell you want the different elements accept
from the caller.
You can also look in the VXML 2.0 Specification as it'll tell you what
the VXML builtin grammars accept and what they return.
I look at the VXML format, I understand that part.. However, there is no way to convert back to java code. (All the Cisco element are implemented by Java in elements.jar). And I even try to re-write the whole element line by line, and no luck for that.. so I give up this approach. Thanks for help anyway.