Solution data - What to store where and how
When data is cheap (in time and processing) to get, then simply get on demand. This reduces memory footprint in the running engine. When this does not apply - for example because a call takes a long time, or processing of the result is expensive - it may be advantageous to store the data.
Teneo provides a number of different ways, scopes and techniques for this.
Data scope
- Shared data: When data is the same for all sessions and doesn't change over time, use a static property in a class defined in Solution Loaded script Static data in Teneo Solutions.
- When data needs to be shared between all sessions but changes over time, use an external service to ensure all sessions on all publish targets share the same view of the data.
- Session data: When data is session specific, use a Global variable.
- Task data: When data is required to perform a single task - this is likely to be within a flow, use a Flow variable.
- Historic Task data: When data from a previous task execution is useful in a future task execution, use the dialog history to get previous values on demand Data from Dialogue History.
Data requirement
- Required data: When data is always required (every session will need this information), load up front:
- Populate in Solution Loaded script for Shared data (eg. database location, connection credentials, regex definitions).
- Populate in Begin Dialog script / variable default value for Session data (eg. user configuration, connection method, channel).
- Optional data: When data is optional (not all sessions will use the information) use a lazy loaded value.
- Class in Solution Loaded script with
Lazy<T>
property for Shared data (eg. office locations, opening hours). - Begin Dialog script / variable default value with
Lazy<T>
value for Session data (eg. user configuration, connection method, channel).
- Class in Solution Loaded script with