October 21, 2013

Automatically refresh StartCenter

Users that heavily rely on StartCenters to check for incoming tickets or work orders sometimes ask if the StartCenter can automatically refresh itself.

To accomplish this you can inject a small JavaScript into the StartCenter JSP code.
Backup [SMPDIR]\maximo\applications\maximo\maximouiweb\webmodule\webclient\components\startcenter-options.jsp file and open it with a text editor.
Search for a row like this

<table ...

Add the following code just before that row.

<!-- BEGIN StartCenter automatic refresh -->
<script type="text/javascript">
  setTimeout("location.reload(true)", 60000);
<!-- END StartCenter automatic refresh -->

The refresh time in the previous script is in milliseconds so 60000 means 1 minute.

Rebuild and redeploy Maximo EAR file.

Now your start center will be automatically refreshed every 2 minutes.

Maximo 7.5 has introduced an exit warning so you may be prompted with a warning like this every minute.

To avoid this you can disable the exit warning as described in this TechNote.

Be careful when deciding how to set the refresh interval because setting it too low may impact overall system performances.

If this technique is not working you could look at this thread.

Enable autorefresh for one user group

A fellow Maximo consultant has applied this technique only to one user group using the following code.

<%@ page import="psdi.webclient.beans.startcntr.*" %>

  SessionContext sessionContext = new SessionContext(wcs);
  StartCenterAppBean startcenter = (StartCenterAppBean)sessionContext.getCurrentApp().getAppBean();
  psdi.mbo.MboRemote mbo = startcenter.getMbo();
  String where = "groupname = '[GROUPNAME]' and userid in (select userid from maxuser where personid = '" + mbo.getUserInfo().getPersonId() + "')";
  psdi.mbo.MboSetRemote groups = mbo.getMboSet("$GROUPUSER", "GROUPUSER", where);

  if ( !groups.isEmpty() ) 
    <script type="text/javascript"> setTimeout('window.location=window.location' ,10000); </script>

catch (Exception e) 

The [GROUPNAME] must be replaced with the security group for which you want to enable the start center autorefresh.

JedrekWiehas suggested to modify the script to set the session id in order to avoid duplication os user's sessions.

String refreshUrl = wcs.getMaximoRequestURI()
                  + "?event=loadapp&value=startcntr&"
                  + wcs.getUISessionUrlParameter()
                  + wcs.getCSRFTokenParameter();
<script type="text/javascript"> setTimeout('window.location=window.location' ,10000); </script>


  1. Hello,

    recently I faced similar requirement - refresh Start Center every minute for specific user.
    I followed your instruction and it almost worked... After several auto-refreshes unfortunately Maximo started to reply with HTTP 503 error "You have reached the maximum number of sessions allowed for a user."
    After some investigation I noticed that once user logs in he's forwarded rather than redirected to Start Center. It means browser URL address remains http:///maximo/ui/login. When you periodically start to issue JS "window.location=window.location" then every time request reaches server new user UI session is created and eventually mxe.webclient.maxUISessionsPerHttpSession is exceeded.
    In order to avoid creating new UI session within the same web session you need to make sure that URL contains uisessionid query parameter. Actually there is one more URL query parameter called csrftoken that shall be rewritten as well.
    So the final solution looked as follows:

    psdi.security.UserInfo ui = wcs.getUserInfo();
    if (ui.getUserName().equals("MAINTVIEW")) {
    String refreshUrl = wcs.getMaximoRequestURI() + "?event=loadapp&value=startcntr&" + wcs.getUISessionUrlParameter() + wcs.getCSRFTokenParameter();
    // [script type="text/javascript"]setTimeout('window.location=""', 60000);[/script]

    I hope this will let to avoid some of you the same problem I faced.

    BTW: I'm sorry but I couldn't parte scriptlet into the blogspot comment window so pay attention that sample script above requires tiny modification to actually output commented line as a part of HTTP response.

    1. Thank you Jedrek !
      I have updated the post.

  2. This comment has been removed by the author.

  3. How to configure the same in INCIDENT application