Contents
- 1 IWDBP Strategies & Subroutines from 9.0.009
- 1.1 Global variables
- 1.2 Classification Strategy
- 1.3 Prioritization Strategy
- 1.4 Invoke UCS Strategy
- 1.5 InvokeGRE Strategy
- 1.6 Distribution Strategy
- 1.7 CheckBusinessValueandPriority Subroutine
- 1.8 AssignLastError Subroutine
- 1.9 FindListObjectItem Subroutine
- 1.10 MarkInteractionAsDone Strategy
- 1.11 Removal Strategy
- 1.12 Finish Strategy
IWDBP Strategies & Subroutines from 9.0.009
Global variables
Timeout for userdata changes
During a task life cycle, its interaction properties are changed asynchronously. Without sufficient timeout to receive confirmation event from Interaction Server, ORS might continue workflow execution with unfinished property updates. This could lead to unexpected behavior—for example, tasks could go to the ErrorHeld queue sporadically without visible reasons.
To address such issues, there is a configurable timeout within UserData blocks and other places where interaction properties are changed (for example, the AfterEspCallActivities block in the InvokeGRE strategy). If a timeout event occurs, an interaction goes to the ErrorHeld queue with a corresponding error message assigned to its Userdata. This timeout could be set globally using the vWaitTimeoutSec variable on the project level. The default value is 10 seconds. The timeout should be calculated individually and specifically, depending on the delay in the Interaction Server response. To set its value, do the following:
- Click on the Entry block of any strategy.
- Select the Properties tab at the bottom of the Composer window.
- Click on the dots next to Global Settings -> Variables to open the Application Variables window.
- Expand the Project Variables item and set the vWaitTimeoutSec value.
Classification Strategy
The purpose of this strategy is to invoke corresponding classification rules, analyze the result of the rules application and place the interaction into the appropriate queue, depending on the result.
This strategy processes interactions from the following queues:
- iwd_bp_comp.Main.iWD_New
Interactions have to satisfy the following conditions:
- There are no conditions here.
- Interactions are taken in order they were submitted.
Composer Configuration
The Composer configuration for this strategy block shows that all interactions are distributed to the iwd_bp_comp.Main.iWD_New queue without conditions.
Flow Summary
Flow Detail
- Entry to Classification workflow.
- The InvokeUCS subroutine is invoked to create new interaction in the UCS database.
- The InvokeGRE subroutine is invoked.
- The interaction is placed in the iwd_bp_comp.Main.iWD_Captured queue.
- Exit Classification workflow.
- Log message in case if interaction was from some reasons deleted.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Error.
- vInLastErrorString—Error description that occurred in InvokeUCS subroutine.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Error
- vInLastErrorString—Error description that occured in InvokeGRE subroutine.
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
Prioritization Strategy
The purpose of this strategy is to invoke the corresponding prioritization rules, analyze the result of the rules application and place the interaction into the appropriate queue, depending on the result.
This strategy processes interactions from the following queues:
- iwd_bp_comp.Main.iWD_Captured—Interactions have to satisfy the following conditions:
- Active interactions only (interactions which do not have the property IWD_activationDateTime set, or this property has a time stamp which is in the past.
- Interactions are taken in the order they were submitted.
- iwd_bp_comp.Main.iWD_Queued—Interactions have to satisfy the following conditions:
- Interactions that are subject for immediate reprioritization (interactions that have the property IWD_reprioritizeDateTime set to a time stamp which is in the past).
- Interactions are taken in order of IWD_reprioritizationDateTime (oldest first).
Composer Configuration
Flow Summary
Flow Detail
- Entry to Prioritization workflow.
- The InvokeGRE subroutine is invoked.
- Log message in case if interaction was from some reasons deleted.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Error
- vInLastErrorString—Error description that occurred in InvokeGRE subroutine.
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit Prioritization workflow.
Invoke UCS Strategy
The purpose of this workflow is to create an interaction in the UCS database if UCS is configured.
Flow Summary
Part 1
Part 2
Flow Detail
- Entry InvokeUCS strategy.
- Check if in_method_name = 'Create' | in_method_name = 'OMInteractions'.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Error
- vInLastErrorString—Error informs that: vInMethodName + ' is not valid'
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit InvokeUCS workflow.
- Variables are initialized:
- vExternalId—Read from task attribute ExternalId
- vMediaType—Read from task attribute
- vSubmittedBy—Read from task attribute attr_itx_submitted_by
- vType—Read from task attribute 'InteractionType'
- vSubType—Read from task attribute 'InteractionSubtype'
- vIwdIsAddedToContactServerValue—Read from task attribute 'IWD_isAddedToContactServer'
- Check if in_method_name = 'Create'.
- The FindListObjectItem subroutine is invoked to determine the name of the UCS Application. The subroutine uses the List Object list GREServerList:
- vInItemName—ContactServerList
- vInListName—Iwd_Esp_List
- The strategy calls a method on the Universal Contact Server to set the status of the interaction to 3, indicating that the interaction is done.
- The value of the user data key IWD_isDone is set to 1.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Error'
- vInLastErrorString—Error description that occurred when variables were initialized
- The FindListObjectItem subroutine is invoked to determine the name of the UCS Application. The subroutine uses the List Object list GREServerList:
- vInItemName—ContactServerList
- vInListName—Iwd_Esp_List
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Determination_Error'
- vInLastErrorString—Error description that occurred in FindListObjectItem subroutine.
- The value of the user data key IWD_isContactServer is set to 0.
- The value of the user data key IWD_isContactServer is set to 1.
- Check if IWD_isContactServer is set to 1.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Determination_Error
- vInLastErrorString—Error description that occurred in FindListObjectItem subroutine.
- The value of the user data key IWD_isDone is set to 0.
- An error is extracted from user data and assigned in vLastError variable.
- If it makes sense to retry updating the interaction record in UCS.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Error
- vInLastErrorString—Information that it does not make sense to retry update interaction in UCS.
- A delay is introduced into the processing. Flow returns to step 8.
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit InvokeUCS workflow.
- A new interaction is created in the UCS database, for this iWD task.
- An error is extracted from user data and assigned in vLastError variable.
- The user data key IWD_isAddedToContactServer is updated to 1 to indicate that the task was successfully added to the interaction history in UCS. The result returned from the ESP call to UCS (from See A new interaction is created in the UCS database, for this iWD task. If that function is successful is written to the variable IWD_UCS_Result.
- If it makes sense to retry creating the interaction record in UCS.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Error
- vInLastErrorString—Information that it does not make sense to retry create interaction in UCS
- A delay is introduced into the processing. Flow returns to step 12.
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit InvokeUCS workflow.
InvokeGRE Strategy
Composer configuration
Flow Summary
Part 1
Part 2
Part 3
Flow Detail
- Entry to InvokeGRE strategy.
- Check if in_method_name is set to SetBusinessContext or Prioritize.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Error
- vInLastErrorString—Error informs that: vInMethodName + ' is not valid'
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit InvokeGRE workflow.
- The FindListObjectItem subroutine is invoked to determine the name of the Genesys Rules Engine Application. The subroutine uses the List Object list GREServerList:
- vInItemName—GREServerList
- vInListName—Iwd_Esp_List
- Check if vInCustomPackageName was published to this subroutine. If it is set then vInCustomPackageName will be run. Otherwise package name needs to be found in Iwd_Package_List.
- Assign vInCustomPackageName to vGrePackageName.
- Delete IWD_GRE_Result, IWD_Error, RulePhase before Invoke GRE.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Determination_Error
- vInLastErrorString—Error description that occurred in FindListObjectItem subroutine.
- The FindListObjectItem subroutine is invoked to determine the name of the rule package that the Genesys Rules Engine will be invoking to evaluate the classification rules:
- vInItemName—RulePackageList
- vInListName—Iwd_Package_List
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_Rule_Package_Determination_Error
- vInLastErrorString—Error description that occurred in FindListObjectItem subroutine.
- An ESP request is sent to the Genesys Rules Engine to evaluate the classification rules.
ImportantAll user data that needs to be added to ESP request must be added in User Data attributes.
- Parse ESP result and attach to the interaction all attributes modified by the GRE.
- Assign the string AfterEspCallActivities timeout to the vLastError variable.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Error
- vInLastErrorString—Error informs that: Attach GreResult timeout
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit InvokeGRE workflow.
- CheckBusinessValueAndPriority subroutine is called to verify if IWD_businessValue and Priority have correct values.
- Check if in_method_name is set to SetBusinessContext or Prioritize.
- Check if IWD_processId was set by any rules or when task was created.
- Check is made to see if this is the first time that prioritization rules are being evaluated for the interaction, and the priority was not set up by any rules.
- Get last error that was occured in GRE call and assign it to vLastError variable.
- A check is done to see if the error code is related to the ESP server communication.
- A delay is introduced, based on the value of the _delay_ms variable. The flow goes back to step 11 to retry the connection to the ESP server.
- The last Interaction Server-related error is extracted from a variable.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Error
- vInLastErrorString—The last Interaction Server-related error is extracted from a variable.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Error
- vInLastErrorString—The last Interaction Server-related error is extracted from a variable.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_GRE_Error
- vInLastErrorString—The last Interaction Server-related error is extracted from a variable
- The interaction is placed in the iwd_bp_comp.Main.iWD_Rejected queue.
- Exit InvokeGRE workflow.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_Prioritization_Error
- vInLastErrorString—Error description: Priority is not set up by rules.
- The interaction is placed in the iwd_bp_comp.Main.iWD_Queued queue.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—vIwdClassificationError
- vInLastErrorString—Error description: Process was not set by rules.
- The interaction is placed in the iwd_bp_comp.Main.iWD_Captured queue.
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit InvokeGRE workflow.
Distribution Strategy
This strategy routes interactions to a requested Agent, requested Agent Group, requested Skill, or to the default iWD Agent Group. This strategy processes interactions from the following queues:
- iwd_bp_comp.Main.iWD_Queued—Interactions have to satisfy the following conditions:
- Interactions that are not subject for immediate reprioritization (interactions that do not have the property IWD_reprioritizeDateTime set, or that have this property set to a time stamp that is in the future).
- Interactions are taken in order of priority (highest priority first)
A Segmentation feature ensures that all agents can be kept busy by distributing tasks in each segment separately. As a result, even in a Distribution strategy that is populated by high-priority tasks assigned to small groups of agents, the strategy will not become so saturated that distribution of tasks to other agents is blocked. Segmentation settings are found in the ToDistribute view of the Distribution routing strategy. The Distribution strategy can make a call to the segmentation setting and add an IWD_Segment attribute to the interaction data.
Composer Configuration - Segmentation View
Flow Summary
Part 1
Click to enlarge.
Part 2
Click to enlarge.
Part 3
Click to enlarge.
Flow Detail
- Entry to Distribution workflow.
- Variables are initialized:
- vRequestedAgentGroup—Read from task attribute IWD_ext_requestedAgentGroup
- vRequestedAgentGroup—Read from task attribute IWD_ext_requestedAgent
- vRequestedSkill—Read from task attribute IWD_ext_requestedSkill
- vCurrentTint—Current time in seconds
- vReprioritizeDint—Read from task attribute IWD_businessValue
- vDefaultTargetTimeout—Default target timeout set to 3600 seconds
- vInxPriority—Read from task attribute Priority
- Delete IWD_Route_Error from attached data. Calculate WaitTarget timeout based on vReprioritizeDTInt and vCurrentDTInt. Sets URS priority.
- Set information about clear IWD_Route_Error attribute.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_Error
- vInLastErrorString—Error description: 'Update IWD_Route_Error timeout'
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Calculate vWaitTargetTimeout.
- Check if calculated vWaitTargetTimeout is in range (0, vDefaultTargetTimeout>.
- Set vWaitTargetTimeout to vDefaultTargetTimeout.
- Exit Distribution workflow.
- Check if particular Agent is requested.
- Assign vRequestedAgent + '.a' to vRequestedAgent variable.
- Set vIWDSegment to '_requested_agent'.
- Route interaction to requested vRequestedAgent without waiting.
- Set vIWDSegment to '_requested_skill'.
- Route interaction to requested vRequestedAgent with requested skill without waiting.
- Set vRouteGuardTimeout to Route Interaction timeout (vWaitTargetTimeout) plus vRouteGuardDelay. vRouteGuardDelay is 15 seconds by default and can be configured using User Variables dialog for Distribution strategy.
- Add event QueueSubmitGuardEvent to the event queue to be raised after vRouteGuardTimeout seconds.
- Check if particular AgentGroup is requested.
- Assign vRequestedAgentGroup + '.qa' to vRequestedAgentGroup variable.
- Set vIWDSegment to '_requested_agent_group'.
- Route interaction to requested vRequestedAgentGroup with vWaitTargetTimeout.
- Set vIWDSegment to 'default'.
- Route interaction to IWD Agent Group with vWaitTargetTimeout.
- Log message in case if interaction was from some reasons deleted.
- Assign last route interaction error to vLastError.
- Check if route interaction finished with an error.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_Route_Error
- vInLastErrorString—Error description that occurred in route interaction
- Exit Distribution workflow.
- Cancel event QueueSubmitGuardEvent if it was not raised.
- Exit Distribution workflow.
CheckBusinessValueandPriority Subroutine
The purpose of this workflow is to verify if Priority and IWD_businessValue have correct values.
Flow Summary
Part 1
Part 1
Flow Detail
- Entry to CheckBusinessValueAndPriority workflow.
- Variables are initialized:
- vIwdBusinessValue—Read from task attribute IWD_businessValue
- vIwdPriority—Read from task attribute Priority
- Validate if vIwdBusinessValue is valid.
- Set vIwdBusinessValue to vMinBusinessValue.
- Set vIwdBusinessValue to vMaxBusinessValue.
- Update IWD_businessValue to vIwdBusinessValue.
- Validate if vIwdPriority is valid.
- Set vIwdPriority to vMinPriority.
- Set vIwdPriority to vMaxPriority.
- Update Priority to vIwdPriority.
- Exit CheckBusinessValueAndPriority workflow.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_Error
- vInLastErrorString - Error description: 'Update Priority timeout'
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_Error
- vInLastErrorString— Error description: 'Update iWD_businessValue timeout'
- The interaction is placed in the iwd_bp_comp.Main.iWD_ErrorHeld queue.
- Exit CheckBusinessValueAndPriority workflow.
AssignLastError Subroutine
Flow Summary
Flow Detail
- Entry to AssignLastError workflow.
- The last error is attached to user data as a key-value pair with the key vInLastErrorkey and value vInLastErrorString. vInLastErrorkey and vInLastErrorString are workflow attributes that need to be set before calling this workflow.
- Log message if interaction was from some reasons deleted.
- Exit AssignLastError workflow.
FindListObjectItem Subroutine
Flow Summary
Flow Detail
- Entry to FindListObjectItem workflow.
- Search vKeyToFindInListObject in vInListName.
- vInItemName—Section in vInListName
- vInListName—List object where vKeyToFindInListObject should be searched
- vKeyToFindInListObject—Option in vInItemName that should be found
- When vKeyToFindInListObject is found in vInListName, then the value assigned to this option will be assigned to vOutListObjectItem.
- Exit FindListObjectItem workflow.
MarkInteractionAsDone Strategy
The purpose of this strategy is to update the Universal Contact Server (UCS) database to mark the interaction as done. This equates to setting the value in the Status column of the Interactions table to 3. UCS clients, such as Interaction Workspace, will then display the status of this interaction as done when the user looks at interactions they have previously processed.
Interactions have to satisfy the following conditions:
- The value of the attached data key IWD_isContactServer is 1
- The value of the attached data key IWD_isDone is either null or 0 (zero)
Flow Summary
Flow Detail
- Entry to MarkInteractionAsDone workflow.
- The InvokeUCS subroutine is invoked to complete interaction in the UCS database.
- Invoke AssignLastError subroutine with attributes:
- vInLastErrorkey—IWD_UCS_Error
- vInLastErrorString—Error description that occurred in InvokeUCS subroutine
- Exit MarkInteractionAsDone workflow.
Removal Strategy
The purpose of this strategy is to delete expired interactions from the Interaction Server database.
A key-value pair in user data with the key IWD_expirationDateTime contains information about when an interaction has to be deleted.
This strategy processes interactions from the following queues:
- iwd_bp_comp.Main.iWD_Completed
- iwd_bp_comp.Main.iWD_Canceled
- iwd_bp_comp.Main.iWD_Rejected
Interactions have to satisfy the following conditions:
- Interactions must either have the property IWD_expirationDateTime not set, or this property must have a time stamp which is in the past.
- If UCS is available, interactions must be marked as done in UCS.
- Interactions are taken in the order they were submitted.
Composer Configuration
Flow Summary
Flow Detail
- Entry to Removal workflow.
- Log message in case if interaction was from some reasons deleted.
- Log message: Task will be terminated on exit
- Exit Removal workflow.
Finish Strategy
This workflow detaches interactions from the session. This workflow processes interactions from the following queues:
- iwd_bp_comp.Main.iWD_Errorheld
Flow Summary
Flow Detail
- Entry to Finish workflow.
- Log message :'Task processing completed'.
- Detach interaction. After this operation, the interaction will not be processed any more.
- Log message in case if interaction was for some reason deleted.
- Exit Finish workflow.