which is the best subdialog or javascript RRS feed

  • Question

  • Hi,

    Can anyone please let me know whether a subdialog or javascript is best in the following senario:

    I have a form where I will get 4 n-best from the recognizer. So am passing these values to a subdialog. Where in the subdialog am check for some conditions and also check for the his past records. depending on the result of the sub dialog I will prompt the user. Will it be okay if I use subdialog for this? becoz I need to call in many forms of my application.

    And also when considerting performance will it go down when we use sub dialog?

    Thank you

    Tuesday, October 13, 2009 4:01 PM

All replies

  • A subdialog within the same VXML document is cheap. A dynamically generated subdialog is an HTTP fetch + your server-side processing + parse and execution time on top of that.

    If you need server-side processing, Javascript is no substitute. If you don't, then it depends on what the processing entails.

    Why don't you try it and see?
    Tuesday, October 13, 2009 6:54 PM
  • I defined the subdialog in a seperate file "nbest.vxml". and I am calling this subdialog in "main.vxml".

    I dont have any server-side processing in the sub dialog "nbest.vxml", I have many if conditions that am validating in subdialog.

    1. Can you please let me know since i defined it in a seperate file will it use HTTP fetch to get the file?

    2. if it is HTTP fetch will it be best to define in approot.vxml to avoid HTTP fetch?

    3. Since its just validation and if condtions,  if i chage sub dialog to javascript will the performance go up?

    Thank you

    Tuesday, October 13, 2009 8:07 PM
  • 1. Yes, it will be a separate fetch.

    2. Don't put it in the app root. Put it in the document that's calling it.

    3. Your validation itself uses Javascript. (All those if conditions...). If you're only using the subdialog to encapsulate some logic, then replacing that with a short script would probably be a win.
    Tuesday, October 13, 2009 8:58 PM