This document was generated from CDN thread
Created by: null on 28-03-2008 06:46:33 PM
Element data not getting reset-
When a OSDM is hit twice in a call, all the element data are not getting reset when the module is hit the second time.
First time the caller said "dont_know", which was passed in a element data called command from the grammar. Second time through the same OSDM, caller said "help", which was passed in another element data called value. But, according to the logs, the element data value was set to "help" and element data command was set to "dont_know".
Why is the the element data command not getting reset?
Subject: RE: Element Data
Replied by: null on 09-05-2008 04:01:09 PM
When an element is re-visited in a callflow, the element data is not reset. This is because there could be a need for an element to get the data from its previous visit.
The only element data that will be overridden would be element data that is set the second time it is visited. This would work out fine for elements that set the same amount of element data each time. For example, if every time an element is visited it created element data named "abc", then the next time it was visited the old value of the element data would be replaced with the new value.
For other elements, such as wrapper elements around OSDM elements, that stores a variable amount of element data each time it is visited, there would be "old" stale data left over from the first visit to the element as you saw.
Most of the time elements that store a variable amount data are because they are storing n-best results that differ each time the element is visited due to the different utterances. However most elements will store element data describing how many utterances were returned and using this data you should be able to get only the relevant data and not any of the stale data. For example, with the Form element, if the number of results for the first time it is visited is 3 and then the number of results is 2 for the second visit, then the 3rd value from the first visit of the element would remain even after the element was visited a second time. However the element data variable "nBestLength" [i:9daf4e9ee7]would[/i:9daf4e9ee7] be replaced and be 2, so as long as this element data is used to iterate through the return values you would never see the stale data as you would stop after looking at 2 results.
So if you are writing your own element, you can choose to delete all element data for that element when it is first visited and that will ensure no stale element data will persist.
Hope that helps.