Administrators must sometimes restart Maximo instances in order for their changes to be fully applied or even visible for the end users, one of the reasons is that Maximo stores many of its configurations in Cache HashMaps, and these Cache repositories are reloaded when Admin Mode is turned off or, obviously, when Maximo starts up, some of those changes may include:
Maximo reloads its Cache automatically in the below cases:
There are 3 methods in the psdi.server.MXServer class we can use to reload the cache:
• reloadMaximoCache(boolean updateAllServers)
: Reloads all Maximo Caches
• reloadMaximoCache(String cacheName, boolean updateAllServers)
: Reloads specific Maximo Cache
• reloadMaximoCache(String cacheName, String key, boolean updateAllServers)
: Reloads a specific component of the Cache.
We could easily use the first method, but I saw it is a good idea to use the same logic used by Maximo after Admin Mode is turned off.
We should decide where to place such an action, the Database Configurations is a good application to launch this action from. That action will launch an automation script that will reload all the Maximo Cache repositories.
We will perform the below steps to add an action menu item, that will eventually launch an automation script:
1. Go to Application Designer Application
2. Open the application definition for Message Tracking application.
3. From the Select Action menu, choose Add/Modify Signature Options.
4. When the dialog is displayed, click New Row, and add the name and description of the action, for instance:
5. Expand the Advanced Signature Options and choose the option that reads: This is an action that must be invoked by user in the UI.
6. Click OK.
7. From the Select Action menu, choose Add/Modify Select Action Menu.
8. When the dialog is displayed, click New Row, and add the details of the signature option you just created:
Remember, for an automation script to run on the list tab, there should be at least one record in the results table.
9. Click OK
10. Do not forget to grant the access to run this action to the right security group.
Reloading Maximo Cache might take several seconds to complete, so it is going to be very frustrating for the user if they click the action by mistake, therefore, it is a good idea to create a warning message for them.
1. From the Select Action menu, choose Messages.
2. When the dialog is displayed, click New Row, and add the details of the warning message as in the below screenshot
After that we have to create the automation script, we will use for this purpose an Action Launch Point:
1.Go to Automation Scripts application.
2. From the More Actions menu, choose Create Script with Action Launch Point.
3. Fill the Launch Point Name and description, and the Action name and description
4. Since Maximo will not allow us to use any internal object as a lunch point object, we cannot use MAXOBJECT or MAXOBJECTCFG for this launch point, but we can still use another object, I am using MAXUSER here.
5. Click Next
6. Fill out the script name and description, then choose the language as Python.
7. Copy and paste the below script source code, then click Create
#-----------------------------------------------------------------------
# Name: MAXCACHE
# Description: Reload Maximo Cache
#
# @author Wael El-Khalil
#-----------------------------------------------------------------------
from psdi.server import MXServer
userChoice = service.yncuserinput()
if (userChoice == service.YNC_NULL):
service.yncerror("system", "maxCache")
elif (userChoice == service.YNC_YES):
mxserver = MXServer.getMXServer()
cacheNames = mxserver.getMaximoCacheNames()
mxserver.reloadMaximoCache("MAXPROP", True)
mxserver.reloadMaximoCache("MAXIMODD", True)
mxserver.reloadMaximoCache("MAXIMOMLDD", True)
mxserver.reloadMaximoCache("MAXMESSAGECACHE", True)
mxserver.reloadMaximoCache("MAXVARS", True)
cacheNames.remove("ADMINMODE")
cacheNames.remove("MAXPROP")
cacheNames.remove("MAXIMODD")
cacheNames.remove("MAXIMOMLDD")
cacheNames.remove("MAXMESSAGECACHE")
cacheNames.remove("MAXVARS")
i = cacheNames.iterator()
while (i.hasNext()):
cacheName = i.next()
mxserver.reloadMaximoCache(cacheName, True)
Wael El-Khalil
IBM certified Maximo techno-functional Consultant
Wael is an IBM Certified Maximo techno-functional consultant since 2010, based in Brisbane, Australia, he gained his experience working for consultancy companies in the Middle East and Australia, and at the client side as Maximo Project Manager at the Roads and Transport Authority in Dubai. Throughout his Maximo years, he worked with clients such as Australian Gas Group, BP, Port Waratah Coal Services, ADNOC Group, DP World, Abu Dhabi Water and Electricity and helped them implement Maximo, its add-ons and industry solutions (Service Provider, Transportation, Oil and Gas, HS&E, Scheduler, etc..), and integrate it with systems such as Oracle E-Business Suite, SAP, JDE. SCADA. Vocollect, and many others.