Deploying the URS Strategy Subroutines
Genesys Predictive Routing (GPR) provides subroutines components that are integrated with your Genesys Routing solution. The subroutines are placed within an existing strategy, where they add agent scoring and best-match functionality that enables you to fine-tune the routing of a specific interaction to the agent who can best handle it, based on the KPIs you want to optimize.
This topic explains how to use the pre-configured strategy subroutines with Interaction Routing Designer (IRD) and Universal Routing Server (URS). This topic includes the following information:
- List of subroutines and other files included in the IP, with brief explanations of what they do.
- Deployment procedures.
- An explanation of how the subroutines operate.
For information on how to deploy the Composer Subroutines, see Composer, Orchestration Server (ORS), and URS.
- If you would like to evaluate Genesys Predictive Routing for use with schedule-based routing (using Genesys Workforce Management), service-level routing, or business-objective routing, contact Genesys Professional Services for a review of your routing environment.
- For descriptions of how the subroutines handle agent-surplus and interaction-surplus scenarios, see Interaction Flows.
Out-of-the-Box IRD/URS Strategy Subroutines
The IP for the URS Strategy Subroutines component contains the following strategy subroutine RBN files as well as the object.kvlt file and the Predictive_Route_Data_Template.cfg file. (The RBN files are listed in alphabetical, not logical, order.)
- ActivatePredictiveRouting_v3: Called from a routing strategy when the conditions you specify are met. This subroutine automatically calls additional subroutines that score agents, rank the scored agents, and evaluate whether there is an agent available to handle the interaction based on agent score. Referred to simply as ActivatePredictiveRouting in the remainder of this topic.
- GetActionFilters: Called from the ActivatePredictiveRouting subroutine to parse the Virtual Agent Group string representation.
- GetScoringAuthToken: Called from the ActivatePredictiveRouting subroutine to authenticate with the AI Core Services REST API.
- GPRIxnCleanup: Cancels the execution of the ScoreIdealAgent and isAgentScoreGood callback subroutines if an attempt to route an interaction with Predictive Routing times out. The strategy then tries to route the interaction using skill-based routing.
- This subroutine must be called from the default port of the last Routing block used for Predictive Routing. You must also set the Clear targets flag in that Routing block. Alternatively, you can configure the strategy to loop back to the same Routing block again after calling the GPRIxnCleanup subroutine.
- GPRIxnCompleted: Attaches Predictive Routing–specific keys to interaction user data. This attached data includes the details required for Predictive Routing performance analysis. Links to the interaction ID in Genesys Info Mart. (Named PRRIxnCompleted in earlier releases.)
- isAgentScoreGood: URS calls this subroutine to suppress routing to an agent who is in ready state if this agent does not provide an acceptable match for the interaction. You can use this in conjunction with relaxation thresholds to target better-matched agents preferentially, expanding the pool of agents if the best-matched agents are unavailable.
- ScoreIdealAgent: Called by URS before routing an interaction to an Agent Group or Virtual Agent Group at the time URS invokes the SelectDN function. This subroutine sorts the agents within the target group according to their scores, in decreasing order. It can also rescale the agent score to the range accepted by URS, if necessary.
- ScoreIdealAgentDefault: Used either when the agent scores for the current interaction are unknown or when running GPR in dry-run mode.
- SetIdealAndReadyCondition: Called from ActivatePredictiveRouting subroutine. This is a wrapper subroutine around scheduling the calls to subroutines such as ScoreIdealAgent and isAgentScoreGood, which are executed outside the main interaction processing flow. Implements the GPR operation modes controlled by the prr-mode option.
- SetIdealAndReadyConditionforOCS: Required if you are using the Composer Workflow Subroutines.
- objects.kvlt: A text file containing objects required by the strategy subroutines. You must import this file as well as the RBN file for the strategy subroutines to work correctly.
- Predictive_Route_Data_Template.cfg: Template for the Predictive_Route_DataCfg Transaction List object. Stores GPR-related configuration options and values.
Subroutines for Environments Using Dynamic Priority Routing
Release 9.0.014.04 and higher of the URS Strategy Subroutines provide the following subroutines that provide improved dynamic-priority interaction handling:
- ActivatePredictiveRouting_v3 - This subroutine does the following:
- The main routing strategy should set the initial priority for the interaction. The Initialize Variables block takes the initial priority parameter from the skill data List object and saves it to the parBasePriority local variable.
- After a scoring request is completed and the agent scores are placed into the URS Global Map linked to the interaction, the subroutine executes priority increments. This happens once per interaction.
- The subroutine verifies whether the set-dynamic-priority option is set to true. The following steps are executed only on the first routing attempt when the option is set to true.
- The subroutine reads the remaining priority options configured on the Predictive_Route_DataCfg List object (priority-increment, priority-init-interval, and priority-interval).
- The subroutine calls the IncrementPriorityEx function with the required arguments.
Subroutines for Environments Using Non-ASCII Encoding
Release 9.0.014.04 and higher of the URS Strategy Subroutines can support non-ASCII encoding (by default, all GPR components use UTF-8 encoding). The subroutines specified below include enhancements for non-ASCII environments:
- ActivatePredictiveRouting_v3 - Converts non-ASCII characters to UTF-8 characters before sending scoring requests to the Predictive Routing scoring engine.
- GPRIxnCompleted - Converts non-ASCII characters to UTF-8 characters before sending scoring logs.
- GetScoringAuthToken - Replaces the StrFormat function with the SetStringKey function. This eliminates an issue with the ~s character in the StrFormat function, which does not work correctly in a non-ASCII environment.
URS 8.1.400.55 is the minimum required version for GPR-specific IRD subroutines to work in non-ASCII environments.
Installing the URS Strategy Subroutines
The following is a high-level overview of the steps required to deploy the URS Strategy Subroutines:
- Configure URS to Support Predictive Routing.
- Import the subroutines. For a list of the subroutines, with descriptions of their functionality, see IRD/URS Strategy Subroutines.
- Define the entry points in your IRD strategy for the appropriate subroutines.
- Set appropriate values for the strategy subroutine configuration options, which are located in the Predictive_Route_CfgData Transaction List object.
- Configure the parameters for the subroutines used in your environment.
- Test that the subroutines are correctly directing interactions to agents.
The following sections provide detailed instructions for setting up your subroutines.
Configuring URS to Support Genesys Predictive Routing
Perform the following steps to configure URS to work with GPR:
- Create the static_strategy configuration option in the [default] section of the URS Application object and set its value to empty. You can set this option either on the level of individual routing points or on the tenant/URS level. Depending on where you set it, the option works slightly differently. This option takes effect immediately and does not require that you restart URS.
- Configure the http log for URS to check scoring requests and responses. To do this, set the verbose option in the [web] section to 3.
- Set the run_verbose option in the [default] section to 0.
- Set the vqtime option in the [default] section to 13:2048.
- Configure the USE_HTTP environment variable. This enables you to specify HTTP (unsecured) or HTTPS (secured) connections.
Strategy Subroutine Integration for URS/IRD
To use the strategy subroutines provided with Predictive Routing, perform the following steps:
- Navigate to the Export/Import Bar in IRD and import the strategy subroutines from the URS Strategy Subroutines IP.
- For instructions, see the Export/Import Bar topic in the Interaction Routing Designer Help, which you can open from the Universal Routing landing page.
- Open the strategy you plan to use with Predictive Routing and place the ActivatePredictiveRouting Call Subroutine object in the desired location. It must be inserted into the routing strategy before the call to a Routing block or a call to the SelectDN function. The graphic below shows the subroutine insertion points.
- This subroutine requires the following three input parameters:
- skill_target: A STRING indicating the target selected by the URS for an interaction. This must be a virtual agent group.
- skill_data: A LIST, which must contain the following two keys:
- overflow_timeout: A STRING defining a period of time in seconds during which URS tries to route the interaction to the current target.
- base_priority: An INTEGER defining the priority value the interaction has before the call to the ActivatePredictiveRouting subroutine.
- default_skill_data: A LIST, which must contain the following keys:
- AgentScore: Takes either Y or N as its value. To activate predictive routing, you must set this parameter to Y.
- predictor: Contains the name of the section in the Predictive_Route_DataCfg Transactions List configuration object that defines predictor configuration.
- prr-ixn-timestamp: Contains a value defining the number of seconds since midnight when the interaction was queued.
- The isAgentScoreGood subroutine checks for interactions that have been in queue for an unusually long time using the varQueueTimeSec parameter, which is set to 600 seconds by default.
- If you are expecting conditions that might result in longer wait times, you might need to set a larger value for this variable. To change the value of this variable, contact Genesys Customer Care for assistance.
- URS might experience high CPU loads if the timeout is extended beyond 600 seconds and you are using agent hold-out (that is, you have set the value for the use-setreadycondition option to true).
- The GPRIxnCompleted subroutine (called PrrIxnCompleted in earlier releases) can be inserted either as a Custom Routing step in the Routing object or immediately in front of the object in your strategy that contains a call to the RouteCall function.
- In URS Strategy Subroutines releases prior to 9.0.007.00, insert the PrrIxnCleanup subroutine after the green port exit from either the Routing object or the object that contains a call to the RouteCall function.
- NOTE: PrrIxnCleanup is not used in URS Strategy Subroutines release 9.0.007.00 and higher. This update is supported only in environments running URS version 8.1.400.37 and higher.
- Set values for the configuration options in the Predictive_Route_DataCfg Transaction List Object.
How the Strategy Subroutines Work
- ActivatePredictiveRouting: Agent Scores are stored in the global map based on the connid (original, if consult), and the key of the agentid with the value of agent score.
- SetIdealAndReadyCondition sets the URS callback subroutines for SetIdealAgent to ScoreIdealAgent, and SetReadyCondition (if enabled) to isAgentScoreGood.
- The parameters for these callback subroutines are retrieved and verified before the router request is invoked to enable the callbacks.
- The URS targeting, upon determining a list of candidate targets based on the target expression (Skill, Agent Group, and so on) then executes the callback ScoreIdealAgent.
- When an agent becomes ready, isAgentScoreGood is executed to determine if that target is ok to select.
- ScoreIdealAgent retrieves the score for the given agent from the global map set in Step 1. The connid was defined in the parameters set in the router request to SetIdealAgent callback. The result, RES, is the agent score from the map.
- Leaving aside agent occupancy, the SetIdealAgent subroutine returns the value of configured ‘best’ score – this agent’s score. So if this agent has the best score, SetIdealAgent will have a value of 0, which URS interprets as best.
- The isAgentScoreGood callback, assuming max queue time is not exceeded, and it is not a high priority call, and URS is not in overload, the proceeds to retrieve the score for the given agent from the global map set in Step 1.
- The connid was defined in the parameters set in the router request to SetReadyCondition callback. Next the threshold for the minimum acceptable score is calculated if configured. If the agent’s score exceeds the threshold, a value of ‘1’ is Returned, which causes the agent to be set ready for selection.
Effectively SetIdealandReadyCondition is the end of the subroutines. Everything exits after it tells URS to execute one or two extra strategies once it finds a target agent. Once ActivatePredictiveRouting exits, the target block is executed as normal. SetIdealandReadyCondition has told URS to execute ScoreIdealAgent once it finds a target agent. If thresholds are configured for agents SetReadyCondition function of the URS executes isAgentScore good subroutine to determine if the agent selected has a GPR score good enough for routing to.