XBot
  • Overview
    • Introduction
    • How xBot Works
    • Target Audience
    • Key Benefits of xBot
    • Core Concepts of xBot
  • Quick Start
    • Quick Setup
    • Getting Started
      • Zalo Channel
      • Azure Bot Framework
      • FaceBook Channel
      • Team Channel
      • Webchat Channel
      • Email Channel
    • Basic Configuration
    • First AI Flow Setup
    • Initial Testing and Go Live
  • Features
    • Using xBot to Handle End-User Queries
    • Communication Channels
      • Zalo OA
      • Facebook
      • Teams
      • WebChat
      • Email
    • Understanding the Message Handling Flow
    • Understanding AI Bots in xBot
    • Configuring Dispatch Rules in xBot
    • User Functions and Permissions
      • Custom Roles and Permissions
      • Auditing and Monitoring User Activities
    • Cross-Platform Message Type Compatibility
    • AI Flow
      • Core Concepts
      • AI Services
        • Knowledge Base Agent
        • AI Agent
        • AI Proxy Agent
      • Knowledge Base
      • Functions
      • Evaluation Metrics
        • Essential Information
        • Basic Metrics
        • Extra Metrics
  • Integration Guide
    • Integrates with multiple channels
      • API reference
        • Webhook
          • ZaloPushToXBot
          • AzbotPushToXBot
        • Webchat
          • InitForClient
  • References
    • Industry-Specific Use Cases
      • Media and Entertainment
      • Wholesale
      • Transportation and Logistics
      • Manufacturing
      • Energy and Utilities
      • Real Estate
      • Agriculture
      • Travel and Hospitality
      • Healthcare and Wellness
      • Retail and E-Commerce
      • Public Administration
      • Legal
      • Training
      • Education
      • xBot Use Case: Insurance
      • Securities -Use Case
      • Banking - Use Case
      • xBot Use Case: Finance
Powered by GitBook
On this page
  1. Features

Dispatch Rule

Last updated 11 months ago

Introduction to Agent and AI Agent Allocation Rules

This system configures the allocation of conversations to either a human agent or an AI agent based on specific rules. After processing through these rules, the conversation is assigned accordingly. If no agent is assigned due to rule conditions not being met or absence of an available agent, the conversation's status is set to UNASSIGNED. Each group within the system is linked to a particular rule, and without a rule, the group's conversations are automatically set to UNASSIGNED. All incoming messages to a conversation are processed through these rules to determine the appropriate allocation. If the allocation conditions are not met, the conversation retains its current allocation or changes to UNASSIGNED if no suitable agent is found.

Types of Rule Implementation

The system supports two methods of rule implementation: Java bean or Groovy script.

Implementation via Java Bean

Java bean implementation involves coding the rules within the system and then specifying them in the configuration. An example of such a rule setup includes:

  • Abbott Rule: Configures the operational hours of the AI agent throughout the week.

    • During AI agent's hours: When a message arrives, if linked to a group and this rule, the AI agent is assigned to handle and respond to the conversation.

    • Outside AI agent's hours: The rule randomly assigns a human agent from the group to manage the conversation, and the AI agent does not respond automatically.

Implementation via Groovy

Groovy implementation allows for direct configuration through the user interface (UI). For instance:

  • All incoming messages that are linked to a group and this specific rule will be reassigned to an AI agent for handling.

Input and Output Information of the Rule

Java Class: RuleReq

This class handles the input information needed to run a rule:

public class RuleReq implements Serializable {
    private ResultAssignInfo assignInfo; // Current assignment information running for the conversation
    private String conversationId; // Conversation ID
    private String ruleData; // JSON payload configured on the rule
    private String content; // Content of the customer's message sent to the conversation
    // Constructors and getters/setters omitted for brevity
}

Java Class: ResultAssignInfo

This class contains details about the assignment result and additional metadata:

public class ResultAssignInfo implements Serializable {
    private Long groupId; // Group ID
    private String channel; // Channel: ZALO, WEBCHAT, MSTEAMS
    private String botCode; // Bot code configured via webhook
    private String aiCode; // AI Code
    private Long aiId; // AI ID
    private String userId; // User ID
    private String provider; // Provider code
    private String reviewStatus; // Review message status to send to the customer
    private Boolean turnOnAi; // Whether AI is turned on
    private MessageType type; // Message type: ROUTING, CHAT
    private ConversationStatus status; // Conversation status: UNASSIGNED and ASSIGNED
    private String aiPreCode; // Pre-configured AI code
    private ConversationMetaData conversationMetaData; // Metadata of the conversation
    // Constructors and getters/setters omitted for brevity
}

Java Class: ConversationMetaData

This class provides metadata specific to conversations, especially sub-conversations:

public class ConversationMetaData implements Serializable {
    private String subConversationId; // Sub conversation ID
    private String subConversationType; // Type of Sub Conversation
    // Constructors and getters/setters omitted for brevity
}

Java Class: RuleResp

This class outputs the results after the rule execution, specifying the assigned agent or AI agent IDs:

public class RuleResp implements Serializable {
    private String userId; // Agent ID
    private Long aiId; // AI agent ID
    // Constructors and getters/setters omitted for brevity
}

These classes collectively ensure the efficient management and allocation of conversations within the system based on dynamic and configurable rules.