Support Article

Incorrect Duration Clock values

SA-32702

Summary



The Interaction Duration clock is started from some other time and not from zero with Pega Customer Service for Healthcare.


Error Messages



Not Applicable


Steps to Reproduce



1. Login to the system and launch custom interaction portal.
2. Create an Interaction and observe that the clock is getting started from 00:58:58.


Root Cause



CPMCallTimer section is customized at developer end.

When replacing CPMCallTimer with Out-of-the-box (OOTB) rule, the timer is starting properly and no issues were observed.

Developer has customized this rule to achieve timer in the below format.

Required format: 00:00:00 (HH:MM:SS)
OOTB format: 00:00/05:00 (MM:SS/MM:SS)

When developer tried achieving the format with some customizations, could see that the timer is getting started from 00:58:58.

Resolution

Apply below changes to get the required timer format:

1. Set the timer value in the desired format in the map rule "SetSLATimeValues" of PegaCA-Work-Interaction-Call.
example :- 10:15:25 (HH:MM:SS)

2. Below code changes to be made in CPMCallTimer section

a. String sGoal="0", sDeadline="0", gHour="0",dHour="0", gMin="0", gSec="0", dMin="0", dSec="0"; // add the new variable gHour
b. sDeadline = aPage.getString("SLADeadlineTime"); // read the split result of ":" and populate the hour variable. In this case, the 0th index holds the Hour.
temp = sGoal.split(":");
gHour = temp[0];
gMin = temp[1];
gSec = temp[2];

c. tools.putSaveValue("CTITimerGoalString_hour",gHour); // set the value in the clipboard

d. <span id="goalTime"><p:rn="$save(CTITimerGoalString_hour)" m="normal"/>:<p:rn="$save(CTITimerGoalString_min)" m="normal"/>:<p:rn="$save(CTITimerGoalString_sec)" m="normal"/></span> // split the result into 3 separate entities and show as HH:MM:SS

3. Changes need to be done in the CPMCTICallTimer.js file.

The "If" conditions in the below piece of code need to modified to accommodate the hour portion for display.

Current code :-
if(oTimeComponents.hours != 0){
varsTime = cti.util.pad0(oTimeComponents.hours)+":"+cti.util.pad0(oTimeComponents.minutes)+ ":" +cti.util.pad0(oTimeComponents.seconds);
}
else
{
varsTime = cti.util.pad0(oTimeComponents.minutes)+ ":" +cti.util.pad0(oTimeComponents.seconds);
}

Modified code :-
varsTime = cti.util.pad0(oTimeComponents.hours)+":"+cti.util.pad0(oTimeComponents.minutes)+ ":" +cti.util.pad0(oTimeComponents.seconds);

Published January 20, 2017 - Updated February 6, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.