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

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/h
elp_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:
  1. Use Save As to copy pxSessionTimer and rename it to SessionTimer<Project-Name>.

    Copy pxSessionTimer to Session-Timer<Project-Name>
     
  2. 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);
            }
        }
    }

     
  3. Use Save As to copy the Activity, ShowLogoffTimer to your local ruleset, where you have put your SessionTimer<Project-Name>.

    Copy activity ShowLogoffTimer to local ruleset
     
  4. 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.

    ShowLogoffTimer Step 1 method call HTML Stream

    LogoffTimerTest HTML Source
     
  5. 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.

    Copy harness pyCaseManager7 to local ruleset

    Copy portal rule pyPortalHeader to local ruleset
     
  6. Include SessionTimer<Project-Name> section at the bottom of the pyPortalHeader. Specify the parameters as shown in the following images.

    Edit Section pyPortalHeader for Dynamic Layout section

    Edit Section pyPortalHeader to include section SessionTimerTest

    Edit Section pyPortalHeader section SessionTimerTest not editable

    Edit Section pyPortalHeader embedded section SessionTimerTest Layout Properties screen in Modal Dialog

Published September 16, 2016 - Updated October 8, 2020

Was this useful?

50% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

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