Rule Set Overview

Overview

A Rule Set is a group of conditions that evaluate to true or false in order to trigger different conversation flow in a skill. Rule Sets are used as a decision point or branch based on the user's input. For example, if a skill is asking the user to select the application to reset password and they say 'Salesforce'. The skill may need to direct the user to specific skills designed to handle their Salesforce request. Rule Sets are also powerful in controlling the bot flow based on the user’s input.

This article provides an overview of Rule Sets and its key components. For a detailed walkthrough of a RuleSet example, please see Using Rule Sets.

Add a Rule Set to the Conversation Flow

Rule Sets are available within a skill in the Conversation Flow section. To add a RuleSet to the skill, select Rule Set from the Add Conversation Item drop-down list as shown in the following image.

The Rule Set is added to the conversation flow. After any conversation Item is added to the flow, you can drag the item to place it in the right order using the  icon.

Click the Rule Set Conversation item  to expand it. Select Click Here to Add Rule to add a rule. The expanded Rule Set contains three main sections.

  1. A list of rules - The top area lists all rules contained in this Rule Set and what will be executed if the rule evaluates to true.
  2. The rule detail - The middle section shows the details and settings for the currently selected rule with the conditions and behavior when it evaluates to true.
  3. The Fallback Rule - The bottom section contains the Fallback Rule. This is the behavior to execute when all rules within the set evaluate as false. 

Rule

This is the first section that lists all the configured rules as part of the Step. All the rules configured in the step are evaluated in the sequence of their configuration.

Define a Rule

The second section within a RuleSet is the rule detail.


The components of a Rule are:

  • Description: Short description of the Rule defined.
  • Evaluation Criteria: Defines the logic to use when the system evaluates your conditions. The ‘Match any condition‘ rule is True when at least one condition is True which is Boolean OR and the ‘Match all conditions‘ rule is True if all the given conditions are True which is Boolean AND.
  • Conditions: A condition is an attribute with an operator and value. The attribute can be a global or local attribute. The operator is one of 15 commonly used operators including equals, contains, begins with, is empty, and so on. For example, a condition needs to evaluate if the response to the user's prompt is Salesforce. The condition would be @{global.applicationlist} equals Salesforce. Where applicationlist is the Attribute Identifier. Note when using Attributes that you defined in Skill Builder, also known as global attributes, the format must be @{global.attribute_identifier}. Attributes created within the skill, known as local attributes, must be in the format @{local.attributename}. For more information on Attributes see Create Global Attributes.
  • Message: The message is shown to the user when the rule evaluates to True. This field can be left blank as you may not need or want to inform the user that a rule is being evaluated.
  • Set and Clear Attributes: Here you can set or clear global or local attributes based on rule evaluating to true. This is useful for setting values behind the scenes based on the Rule. You may also transform and assign value to global, local, and custom user attributes. For example, if the user responds that they want to reset the password for salesforce, you can set the @{global.issuecategory} to Salesforce and @{global.itgroup} to Application Support. These attributes will create the ticket in the ITSM system with the correct category and assignment group. 
  • KPI Calculation: Set the Luma KPI to calculate when the rule is evaluated as true. Here you can choose the KPI Metrics and the parameter value to indicate how does the skill adds value to the organization. Based on the configuration, KPIs are calculated during the conversation. This is optional and should be configured based on the skill.
  • Execute: This is the last setting for the rule, and it defines if the user should continue with this same skill, exit the skill immediately, or go to another skill. Going to another skill is useful for branching from a generic skill and going to a more specific one.

    Note :

    • The actions defined in the rule are executed in the sequence defined. 
    • OOTB skills and Active custom skills in the bot can be added to the Ruleset.

Set and Clear Attributes

Here you can set or clear global or local attributes based on the rule evaluating to true. This is useful for setting values behind the scenes based on the Rule. You may also use transform functions to modify and assign value to global, local, and custom user attributes. 

For example, if the user responds that they want to reset the password for salesforce, you can set the @{global.issuecategory} to Salesforce and @{global.itgroup} to Application Support. These attributes are used in creating the ticket in the ITSM system with the correct category and assignment group. Clearing attributes is also useful for resetting values to null before triggering a new skill or continuing with the existing skill.

The Sequence of execution drop-down list has two options: Set & Clear Attributes or Clear & Set Attributes. Your selection determines the order that the Set and Clear steps happen. You may want to clear all Attributes and then set new values for other attributes. Both Set and Clear are optional and can be left blank if not required.

Note

Local Attributes are defined within a skill and only exist for the execution of that skill. The local variable value is retained between the prompts and is used to pass data between integrations, user messages, or rules. If used after a bot response, the value in the Local attribute is lost.

Define the behavior when a Rule evaluates to True

When the conditions are evaluated, and the rule is True, the message, if one exists, will be shown to the user, and then the Execute step is done. There are three options under Execute:

  1. Continue - Continues with the existing skill. This is useful when a rule is used for setting or clearing attributes based on user input and then continuing with the skill.
  2. Skill - This is a decision point or branch. The user's input triggers going to another skill. This can be transitioning from a generic skill such as Password Reset to a more specific one Password Reset for Jira or to an OOTB skill such as Transfer to agent, Welcome, What can you do.

  3. Exit - Immediately stops the conversation flow and exits the skill. This is useful for evaluating user input and deciding to end skill execution.
  4. Dynamic Skill - This enables the developer to branch to a skill dynamically. The option expects a skill identifier to branch, which could be available in an attribute or a context variable. For example, to execute the skill with the highest confidence score in the Skill search results, you could set the Execute → Dynamic Skill and provide @{matchedSkill.topSkillIdentifier}
    NOTE: To pass the entities extracted from the initial user phrase to the branched skill, use <skill identifier>@{matchedSkill.entities}. This sets the attributes in the branched skill with the extracted values.

  5. Exit with Suggestions - The option closes the ongoing conversation and guides users to the next actions available. Similar to the 'Exit', immediately closes the conversation flow and exits the skill. Users are presented with the skill suggestions configured for the selected Suggest Skill category.

Note :

You may branch to the following System Skills from the ruleset:
  • Use the "Transfer to an Agent" System skill in the ruleset to transfer the user conversation to a specific support group using the context of the skill
  • Branch to "Welcome" skill to present the end-user with Welcome/What can you do skills.

Set the Fallback Rule

The bottom section contains the Fallback Rule. This is the behavior to execute when all rules within the set evaluate to false. For example, if an employee onboarding skill has the rule to ask the location of the new hire. There are different skills for Canada, and India, and all other countries can continue using this skill. The Ruleset will contain two rules - branching to other skills for Canada and India. The Fallback Rule will be used to continue the current skill execution for all other countries. See the following screenshot as an example.

Adding Additional Rules

Once you complete a rule, you can add another rule by selecting Click here to Add Rule. Follow the same process to add all the rules you need. When you complete your rules, create the skill or save it. If the skill is new, a Build and Publish is required. However, Rule Set updates on their own do not require a build and publish.

To see an example of creating attributes, skills, and a rule set, see Using Rule Sets.

Note

There is no limit on the number of rules in a Rule Set. However, It is not advisable to add multiple rules since the complexity increases, making the troubleshooting process difficult. 

© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com