Entity Collections
Entity collections in attributes
DialogueScript supports working with data entity collections (lists and sets) as attributes, storing automatically their names as references into attribute values (due to technical reasons, data entities cannot be stored directly). Data class must implement NamedEntity interface to provide name property used by entity collection attribute delegate as instance reference.
Scopes turn, session and user are supported (community not yet). Following delegate functions are provided, requiring data entity collection as first and optional second namespace parameters
turnEntityListAttribute
,sessionEntityListAttribute
anduserEntityListAttribute
turnEntitySetAttribute
,sessionEntitySetAttribute
anduserEntitySetAttribute
Example
Name should be considered as primary key thus unique and not changing in time. If your data class define different data suitable to be used as unique name, you can provide it via getter, see following example.1
Maps in attributes
You can use attributes to store maps mapping String keys to values of Any type. Following delegate functions are available to do this
turnMapAttribute
,sessionMapAttribute
anduserMapAttribute
Example
Last updated