views:

51

answers:

1

I need to build a dialog system similar to IVR used in call centers. My system is not phone-based, but the dialog is similar. Something like

System: "Main menu: Enter [1] for menu1, [2] for menu2"
User: [1]
System: "menu1: enter [1] for apples, [2] for oranges, [3] for main menu"
User: [7]
System: "What??"
System: "menu1: enter [1] for apples, [2] for oranges, [3] for main menu"
User: [2]
    ... and so on

I want to have a nice declarative description of all the possible options and a nice way to run through that tree, guided by user input.

Already considered: ANTLR-generated lexer/parser (seems to be an overkill), SCXML-based state machine (seems like only transitions can be declared, the rest needs to be coded)

A: 

I've never seen SCXML before, but after a short glimpse on the project pages and the examples, it looks to me like it has everything you need. Your IVR can be modeled as a state diagram. Entering a state either presents the next choices or starts an activity (while presenting the next menu level is an activity too).

It might be tricky to implement a 'wrong user input' state (or SCXML already has a solution for this common task).

You could invent a small DSL to simplify editing this statemachine. Documents written in this DSL would be translated to SCXML files that would drive the IVR system.

(thanks for the SCXML pointer!)

Andreas_D
SCXML is my candidate at the moment, wrong input thing can be worked around. What I don't like, is that I cannot nicely embed system prompts there, it looks horrible when I try. DSL => SCXML generation might be an option, will think about it
unbeli
What about pushing the prompts into the view an take SCXML only to model the state machine? (--> MVC/MVP pattern)
Andreas_D
yes, good idea, that is also possible. But I am still wondering if there is some more specific tool than SCXML. For example, there is http://en.wikipedia.org/wiki/VoiceXML but it's too attached to voice communication (pauses, etc.)
unbeli