Rule
Rule Cells are compatible with and intrinsically related to the Dynamic Content feature, and may use them to branch paths on your flow.
The Rule Cell allows you to manage and customize the flows according to the variations of the business rule. It’s a resource to make your dialog more assertive and much more precise, as the virtual agent will respond to any changeable scenario.
In a flow, you will often encounter scenarios where the if-then-else conditionals are applicable. For each possibility, you will predict a Rule Cell, always foregrounding the main rule.
Summarizing, Rule Cell is fundamental in flows that need any kind of rules.
If the user informs that is over 18, will be directed by the Rule Cell to a dialog to open his account. Minors will be directed to a dialog informing how to open an account with an adult guardian. In that case, you should write the following code in the Rule Cell:
Use different responses according to channels:
To check if user is logged in:
To check if the shopping cart has items:
To validate confidence level of intent:
For single-variable validation:
If the user wants to create an "escape", a way to execute a flow in which no other scenario fits:
To disambiguate, as an alternative to the use of entities (although the recommended and simplest way to build flows is, actually, using entities). For example: if you want to differentiate a user who wants to check his bank account balance from another user who wants to check his credit card balance, you can predict two (2) Rules Cells:
How can you create a Rule Cell?
Remember to verify your code by clicking on "Validate" before you "Save" it
In the Rule’s Cell value field you can insert the code snippet in JavaScript’s variables (if you wanna know more about this language, access this page) and program any code in it, as long as it’s executable within 100 milliseconds.
The Rule Cell will always be accompanied by a Not Expected Cell, which acts to predict all user interactions outside the guidelines.
The variables below can be used in Syntphony CAI on the Insert code field. Just copy-paste the formula in the table according your scenario:
Important: The variables within the contexts are created by the user, not by the Syntphony CAI platform
How to test the assertiveness of the Rule Cell?
You can test the assertiveness of the Rule Cell and also predict responses with the last user input by using in the Answer Cell a Dynamic Answer (to get more information about Dynamic Answers)
If you’re not familiar with codes, you can copy paste the following shortcuts and put it in the Answer Cell, as a Dynamic Answer:
Intent
Entities and intents are read-only attributes. That means you cannot edit their content.
Entity
Last updated