ConditionalEvent
Registers events that trigger as the result of a true condition.
YAML representation |
condition: string
transitionToScene: string
handler:
object (EventHandler ) |
Fields |
condition |
string
Required. Filter condition for this event to trigger. If condition is evaluated to true then the associated handler will be triggered. The following variable references are supported: $session - To reference data in session storage. $user - To reference data in user storage. The following boolean operators are supported (with examples): && - session.params.counter > 0 && session.params.counter < 100 || - session.params.foo == "John" || session.params.counter == "Adam" ! - !(session.params.counter == 5) The following comparisons are supported: == , != , < , > , <= , >= The following list and string operators are supported (with examples): in - "Watermelon" in session.params.fruitList size - size(session.params.fruitList) > 2 substring - session.params.fullName.contains("John")
|
transitionToScene |
string
Optional. Destination scene which the conversation should jump to when the associated condition is evaluated to true. The state of the current scene is destroyed on the transition.
|
handler |
object (EventHandler )
Optional. Event handler which is triggered when the associated condition is evaluated to true . Should execute before transitioning to the destination scene. Useful to generate Prompts in response to events.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["YAML is used to represent events that are triggered based on a true condition."],["Events can be triggered based on conditions using variables like `$session` and `$user`, boolean operators, and comparisons."],["Optionally, you can define a destination scene for the conversation to jump to when the condition is true."],["Event handlers can be defined to execute before transitioning to a new scene, allowing for the generation of prompts."]]],[]]