Posts

Showing posts from May, 2012

How To Create a Menu Using VoiceModel

VoiceModel does not contain a Menu object that will present users with options and branch in the call flow based on the users input.  So how do you add a menu to your voice application when using VoiceModel? Easy. Just add an Ask object and put conditions on the transitions for the state that renders the Ask object to the IVR browser.  Here is some sample code that you can find in the examples for VoiceModel . public class HomeController : VoiceController { public override CallFlow BuildCallFlow() { CallFlow flow = new CallFlow(); flow.AddState(ViewStateBuilder.Build("mainMenu", new Ask("mainMenu", "Press one for option one. Press two for option two.", new Grammar("digits?maxlength=1"))) .AddTransition("continue", "optionOne", new Condition("result == '1'")) .AddTransition("continue",

Reusable Dialog Components Revisited

A while back we added support in VoiceModel for Reusable Dialog Components (RDC), which I discussed in a previous blog post .  It was an effective implementation but I kept thinking there must be an easier way to create and use RDC's.  After a looking more closely at SCXML and state machines  the answer came to me; composite state machines.  Harel State Machines allow for superstates which are composed of nested state machines.  When a superstate becomes active it first runs the nested state machine that is composed of.  This seemed like a natural fit for RDC's; just make them a nested state machine of the main state machine (call flow).  VoiceModel has been updated to provide support for composite state machines. A lot of other changes have been made to VoiceModel's state machine to make it easier to persist to something like SCXML, actions are now implemented with delegates or lambda expression, and conditions on transitions now support expressions written in Javascript

Voice Application Call Flows: State Machine, Workflow, or Rules Engine

Image
I have been doing some work with workflow engines lately and it got me thinking; what is the difference between a workflow and a state machine? Further reflection had me wondering whether a voice application call flow is best represented by a state machine or a workflow. Discussions I had while working with the VoiceXML Forums Tools Committee raised a third option of using rules engines for more complex applications.  So what is the best option for implementing a voice application? To determine this lets examine what each method of modeling application logic actually is.  But first lets make sure we are on the same page as to what a voice application call flow is. Voice/IVR application call flows are usually designed on paper prior to implementation. This design shows the possible paths a user can take through the voice application depending upon their responses and data that is returned by external and internal systems. A common method of depicting call flow is to use a tool like V