Teneo Developers

Share to

Processing Path

Tryout

The Tryout provides information related to the processing path including the properties for each element which crossed the Engine’s path from an input was given in Tryout till Engine returned the answer text of an Output node; this information includes the Output node and the answer text, the property of any changed Flow Variable, the name, ID, and Folder of the triggered Flow along with other relevant details; learn more about the Tryout’s Path section here.

Teneo Engine access

The data available in the processing path can be accessed through scripts in order to perform certain actions and send/receive messages from the Teneo Engine, as mentioned in the above section, and it is possible to, for example, check the dialogue history in order to find out if a specific Flow has been raised in the current session, or check if a specific word or sign was present in the generated Output text of the current user input turn.

The data is accessible via Groovy scripts within a solution, and the Engine Scripting API Javadoc describes the available methods.

The main entry points into scripting are engineAccess which provides access to the state and functionalities of the Teneo Engine including dialogue history and input Annotations, and engineEnvironment which provides access to the state of the servlet session including Request Parameters and Cookies.

The engineAccess (alias _) provides, among others, the following methods to access the processing path programmatically

  • _.getProcessingPath()

    This method can be used to obtain the path information of the current user input turn

  • _.getDialogHistory()[<history index>].getPath()

    This method allows to obtain the path information of earlier user input turns that can be picked from the session history.

Examples

The script expressions can, for example, be used to check whether the Engine Output text generated during the current user input turn contained a specific sign (in the below example a question mark) or not.

groovy

1_.getProcessingPath().outputText.toListString().contains("?")
2

It is also possible to check the dialogue history to find out if a certain Flow was raised during the current session:

groovy

1_.getDialogHistory().path.flatten().find{it.type=="raiseFlow" && it.name=="Flow_Name"} !=null
2

This is especially useful in Prompt Flow Triggers to ensure that the Prompt Trigger only triggers depending on a specific dialogue history state (for example, if a specific Flow was triggered earlier) without the need to maintain session variables.

Interfacing with API JSPs
Engine Scripting API Javadoc
Scripts in Teneo Studio
Global Scripts
Prompt Triggers
Tryout