Queue Mapping with Rules Engine

Learn how to use the Rules Engine to map chats and emails to a CTI queue based on data contained within the interactions.

Last published on: March 12th, 2024

The Queue Adapter Rules Engine can Route Chats and Emails to the CTI Queue based on the available data. This data can come with the Chat Incident or Email Incident.

Examples of available data include:

  • Oracle Queue
  • Product or Category
  • Any Custom Field

Creating a Rule in the Rules Engine

  1. Select Chat Mapping Rule.
  2. On the Service Tab, enable the Is Enabled checkbox to enable the rule.
  3. Enter a Target Name.
  4. Enter a Display Name.
  5. Select the Rules tab and enter the following C# script.
Delete

NOTE

The last line of the script contains a Custom Processor variable. This should be the name of the custom processor added under the custom processor.


data.Dump("Rules Data");

if( data["MediaType"] == "Chat")
{
 data.RemoveAllExcept("rnIncidentId,FirstName,LastName,EmailAddress,FromAddress,ProductId,CategoryId,TimeCreated,Queue,c_customfield");
 
 string queue = data["Queue"]; // Comment: Use this 'queue' variable in the the switch statement for Oracle Queue based mapping
 // string customField = data["c_customfield"]; // Use this 'customField' variable in the switch statement for custom field based mapping

 switch(queue) 
 {
   case "Marketing": // If Oracle Queue = "Marketing" then Route the Chat to UCCE Queue "MCAL_Chat_7000"
       data["Queue"] = "MCAL_Chat_7000";   
       break;
       
   default: // Route all other Chats to "MCAL_Chat_7010"
       data["Queue"] = "MCAL_Chat_7010";
       break;
 }

}

action.RouteTo("CustomProcessor");
C#
  1. Click Validate button from the button bar to make sure the C# script is valid (no syntax error).

  1. Map the rule to the OSC chat processor.

  1. Add the string Queue to the Custom Processor.