I have a use case where a global listener basically initiates some groovy code, rather than just set a variable. I believe a listener only fires once against each user input? Is it possible to have it keep checking (and firing) across the entire utterance even if it already ‘heard’ something? Adjusting the ‘stop after all sentences tested’ setting didn’t have any effect. It still only ‘fires’ once, despite the utterance matching the listener’s condition several times.
Hi,
You are correct. the Listener will fire only once per user input.
Would you be able to share some details about the use case and what you actually are trying to achieve with the execution script that should fire multiple times for each input?
Thanks for your reply. Yes, the listener really only ‘fires’ once - but for my use-case I was able to put in an acceptable workaround. For example, if I wanted to increment a ‘counter’ variable for every time the listener ‘heard’ something - it would only ever be the value ‘1’ - even if there were multiple matching phrases in the utterance.
%MY_LO.REC^{nCounter++}
So, by doing something like below using the ‘maybe’ operator - it actually picks up on every matching phrase and increments the counter each time. Its a small duplication but acceptable (my actual use-case is a little more complex and has more groovy code)
%MY_LO.REC^{nCounter++} ~ %MY_LO.REC^{nCounter++}
Thanks, @AlO, for sharing your solution to this here with the rest of the Teneo Community