Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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:r n="$save(CTITimerGoalString_hour)" m="normal"/>:<p:r n="$save(CTITimerGoalString_min)" m="normal"/>:<p:r n="$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){
var sTime = cti.util.pad0(oTimeComponents.hours)+":"+cti.util.pad0(oTimeComponents.minutes)+ ":" +cti.util.pad0(oTimeComponents.seconds);
}
else
{
var sTime = cti.util.pad0(oTimeComponents.minutes)+ ":" +cti.util.pad0(oTimeComponents.seconds);
}

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

Suggest Edit

Published February 7, 2017 - Updated December 2, 2021

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us