Support Article
How to apply timeout to the screen
SA-13507
Summary
An application developer referred to the following Help topic to implement timeout:
https://pdn.pega.com/sites/default/files/help_v71/procomhelpmain.htm#definitions/t/timeouts.htm?Highlight=pxSessionTimer
However, the login screen does not display after the timeout. Help is required with setting the RedirectOnTimeout When rule to True.
Resolution
Perform the following local-change:
- Use Save As to copy pxSessionTimer and rename it to SessionTimer<Project-Name>.
- Place the following script at the bottom of the existing <script>, just before the </script> tag in SessionTimer<Project-Name>.
function desktop_restartTimeoutWarningTimer(){
if (pega.desktop.TimeoutTime && pega.desktop.TimeoutTime > 0) {
var nTimeoutWarningTime= (pega.desktop.TimeoutTime - pega.desktop.TimeoutWarningWindow) * 60000;
clearTimeout(pega.desktop.TimeoutWarningCountdown);
if (nTimeoutWarningTime >= 0) {
pega.desktop.TimeoutWarningCountdown = self.setTimeout("desktop_showTimeoutLogoffDialogNew('"+pega.desktop.TimeoutWarningWindow+"')",nTimeoutWarningTime);
}
}
}
function desktop_showTimeoutLogoffDialogNew(strTime) {
var iTime = parseInt(strTime);
iTime = iTime * 60000;
var oSafeURL = new SafeURL("@baseclass.ShowLogoffTimer");
oSafeURL.put("time",iTime);
var ret = window.showModalDialog(oSafeURL.toURL(),iTime,"dialogHeight:210px;dialogWidth:620px;help:no;resizable:yes;status:no;");
if (ret == null || ret == "ok") {
desktop_restartTimeoutWarningTimer();
}
else {
pega.u.d.gDirtyOverride = false;
try{
application.logOff(true);
}catch(e){
pega.u.d.replace('pyActivity=LogOff&pzPrimaryPageName=pyDisplayHarness', null);
}
}
}
- Use Save As to copy the Activity, ShowLogoffTimer to your local ruleset, where you have put your SessionTimer<Project-Name>.
- At Step 1 of ShowLogoffTimer, find a call to the HTML Rule LogoffTimer and rename it to create a new HTML Rule with the HTML code in LogoffTimer-HTML.html.
- Use Save As to copy the harness rule pyCaseManager7 and the portal rule pyPortalHeader to your local ruleset. This ensures that the rules are being called from your local ruleset.
- Include SessionTimer<Project-Name> section at the bottom of the pyPortalHeader. Specify the parameters as shown in the following images.
Published September 16, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.