Teneo Developers

Global Listeners


A Global Listener listens for user input anywhere in the solution; this type of Listener can be used when wanting to listen for certain user inputs regardless of the Flow or transition.

View of Global Listeners

Global Listener window









Listener Ordering


Pre and Post Listeners

There are two types of Global Listeners and the difference between the two is the execution order:

  • Global Pre Listeners: these are run before the user input is tested against triggers, so if the user input matches a Global Pre Listener, the Listener's execution script is executed immediately before any Flow is triggered
  • Global Post Listener: Post Listeners are executed after a Flow is triggered

This means that when wanting to do something before a Flow is triggered, one should use Global Pre Listeners, while Global Post Listeners should be used for those tasks which are performed after the user input has triggered a Flow.

Sentence test order

This section currently only apply toTeneo Studio Desktop

The order which Teneo Engine follows when looking for a match in a multi-sentence user input can be determined by the Teneo user by modifying the Test sentence from option available at the bottom of the Global Listener's window.

Select First to last if Engine should start testing at the first sentence and work forward, or leave the default Last to first if Engine should test the last sentence first and move backwards.

Read more in the Knowledge Base

Limit unused words

This section currently only apply toTeneo Studio Desktop

The Limit unused words setting allows to limit the number of unused words present in the user input, meaning that the Teneo user can specify a maximum number of words which the user input may contain beside those matching the TLML syntax for the match to be satisfied.

To set the Limit unused words simply tick the box and write the number of accepted unused words (or use the up/down arrows).

Read more in the Knowledge Base

Stop after

This section currently only apply toTeneo Studio Desktop

In normal operations, the Teneo Engine stops testing sentences and user inputs once a match is found, but the Stop after setting for Global Listeners allows to modify this behavior providing the following options:

  • First match (Default): testing is stopped when a match is found
  • All sentences tested: the TLML Syntax of the Global Listener is tested against all the sentences in the user input creating an array of results
  • Current sentences tested (only Post-Listeners): the TLML Syntax of the Global Listener attempts to match against the most recent syntax (the previous trigger or input consuming transition).

Read more in the Knowledge Base