Question & Answer
Question
Warning message before http session expiration in the Process Portal.
Answer
The solution described in this article is built on end user inactivity assessment. Please note that solution addresses only http session timeout. Http session expires based upon inactivity. By default the expire time is after 30 minutes of idleness. Having this solution in place won't address LTPA and EJB timeouts. If user's LTPA token is expired, but http session is still valid, after re-authentication(re-login), the session is still available, user can continue to work, no data loss happens.
Solution has been tested on BPM 8.5.5.and BPM 8.5.6 CF2 but should not be limited to only these particular BPM versions.
Instructions:
You will have to change two js files under UIStaticContent folder.
1) Go to BPM installation ..\UIStaticContent\process-server\portal.ear\process-portal.war folder.
2) Backup original static-web.zip archive.
3) Then unpack static-web.zip archive in the current directory.
4) In upacked directory go to static-web\layers\bpmsocial\com\ibm\bpm folder.
5) Open social_base.js.uncompressed.js and add the following javascript code just after the line "dojo.provide("com.ibm.bpm.social_base");":
var timeout = 25; // seconds, should be set to your current http session time out, by default it is 30 minutes; the value is set in seconds; i.e 30 min = 1800 secs
var pos = '',
prevpos = '',
timer = 0,
interval = timeout / 5 * 1000, // msec, interval to perform checks whether we are close to time out, by default interval is 1/5 of the timeout
interval_sec = timeout / 5;
timeout = timeout * 1000 - interval;
function mouseHasMoved(e){
??? document.onmousemove = null;
??? prevpos = pos;
??? pos = e.pageX + '+' + e.pageY;
?? ?
??? if(timer > timeout){
??????? timer = 0;
??????? alert('Your session is timeout.');
??? }
????? ?
}
// notification of the session expiration will be triggered when a result of the following expression is true (timeout - timer) === interval
setInterval(function(){
?? ?
??? if(pos == prevpos){
??????? timer += interval;
??????? if ((timeout - timer) === interval){
??????? alert('Your session is about to expire in'+' '+ interval_sec +' '+ 'seconds.\nThe current time is:' + ' ' + Date());}
??? }else{
??????? timer = 0;
??????? prevpos = pos;
??? }
??? document.onmousemove = function(e){
??????? mouseHasMoved(e);
}}, interval);
6) Save social_base.js.uncompressed.js.
7) Compress social_base.js.uncompressed.js file into the file with name social_base.js. social_base.js is already there but it doesn't contain the changes you just made.
So you will have to override the existing social_base.js file. You can use the following utility to compress the file: http://yui.github.io/yuicompressor/
8) Pack the static-web folder to zip as it was before you unpacked it.
9) Restart a server. And test the changes carefully.
Was this topic helpful?
Document Information
More support for:
IBM On Demand Consulting for Hybrid Cloud
Software version:
All Versions
Document number:
778849
Modified date:
08 December 2018
UID
ibm10778849