Newer Version Available
lightning:omniChannelWorkloadChanged
Indicates that an agent’s workload has changed.
This includes receiving new work items, declining work items, and closing items in the
console. It also indicates that there has been a change to an agent’s capacity or
presence configuration, or that the agent has gone offline in the Omni-Channel
utility.
Response
| Name | Type | Description |
|---|---|---|
| configuredCapacity | number | The configured capacity for the agent. |
| previousWorkload | number | The agent’s workload before the change. |
| newWorkload | number | The agent’s new workload after the change. |
Example
This example prints workload details to the browser’s developer console when an agent’s workload changes.
Component code:
1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2 <lightning:omniToolkitAPI aura:id="omniToolkit" />
3 <aura:handler event="lightning:omniChannelWorkloadChanged" action="{! c.onWorkloadChanged }"/>
4</aura:component>Controller code:
1({
2 onWorkloadChanged : function(component, event, helper) {
3 console.log("Workload changed.");
4 var configuredCapacity = event.getParam('configuredCapacity');
5 var previousWorkload = event.getParam('previousWorkload');
6 var newWorkload = event.getParam('newWorkload');
7 console.log(configuredCapacity);
8 console.log(previousWorkload);
9 console.log(newWorkload);
10 },
11})