Blog
Reset all meter readings
On a development/test environment today I had to reset all meter readings. Maximo is storing the last readings in a set of fields of the ASSETMETER table and the reading history in the METERREADING table. Here are the SQL statements I have used. delete from meterreading; update assetmeter set lastreading=0, lastreadingdate=null, sincelastrepair=0, sincelastoverhaul=0, sincelastinspect=0, sinceinstall=0, lifetodate=0, average=0, lastreadinginspctr=null;
April 1, 2020
Modify Asset's condition code from Work Order
Condition codes are used in Maximo to define various physical states of a particular item. Once the condition code of an asset is set, it becomes readonly and can only be modified using the Move/Modify Asset menu option found in the Select Action menu of the Assets application (link). In some cases it makes sense to allow the technician to update the asset’s condition after a repair or inspection. In this post I will demonstrate how to allow to edit the condition code of the asset from the Work Order Tracking application.
March 14, 2020
Loading Item Assembly Structures (IAS) with MxLoader
I have just releases version 6.2 of MxLoader that contains a brand new template for loading Loading Item Assembly Structures (IAS) into Maximo. An item assembly structure is a list of spare parts and subassemblies required to build an Asset or to define the requirements of a location. Starting from this IBM technote I have created the MXL_ITEMAS object structure including ITEM and ITEMSTRUCT tables. To create the MXL_ITEMAS object structure just click on Create Custom Object Structures in MxLoader ribbon.
January 20, 2020
Ensure Asset's serial number uniqueness
Sometimes you need to ensure the uniqueness of a certain database column in the Maximo database. A common example of this scenario is to ensure that asset’s serial numbers are not duplicated. This can prevent the creation of duplicate assets. In this post I describe two techniques to achieve this using a unique database index or an automation script. Unique Index The simplest and most reliable way of achieving this is to define a unique database index on the SERIALNUM field of the ASSET table. However, we must make some considerations first. The asset serial is not unique alone for two reasons:
January 9, 2020
Send Work Order Calendar invitations
Sometimes a full-fledged mobile solution for Maximo is needed to really mobilize your workforce. Some others a simpler solution can help without the need of additional infrastructure or costs. In this article I will show how to send calendar invitations to workers with work order details and reminders for the activities. The calendar event can have a link to Maximo in order to report progress or close the work order using the standard Everyplace or Work Centers interface.
January 3, 2020
Improved Automation Scripts application
Maximo automation scripts are a very useful tool to implement custom business logic for your customer. After time you may have many scripts to maintain and it may become hard to understand all the logic you have implemented on a specific object. I easy and useful trick I always use is to modify the Automation Scripts application to be able to display and filter script’s launch points. You can see in this screenshot how easy it it to understand what scripts are running on each business object.
January 2, 2020
Maximo Scripting – Library Scripts
This post is an excerpt from the Maximo 76 Scripting Features guide. Library scripts are good for encapsulating some re-usable logic. In Maximo 7.6, we can write library scripts as just simple scripts. We can write these scripts in any language and then call from another language. Lets make a library script for making HTTP GET calls. We can make that using a py script like below. from psdi.iface.router import HTTPHandler from java.util import HashMap from java.util import String handler = HTTPHandler() map = HashMap() map.put("URL", url) map.put("HTTPMETHOD", "GET") responseBytes = handler.invoke(map,None) response = String(responseBytes, "utf-8") Here the script is expecting a variable called “url” to be passed into the script from the invoking script. The response is set to the “response” variable, which can be used by the calling script to get the response data as a string.
December 27, 2019
Service object methods in automation scripts
The service object has been added in Maximo 7.6 script and is very useful in several scenarios. Here is a list of available methods. For more details refer to this page. Logging getLogger(loggerName) log_debug(logMsg) log_debug(logMsg, java.lang.Throwable t) log_error(logMsg) log_error(logMsg, java.lang.Throwable t) log_fatal(logMsg) log_fatal(logMsg, java.lang.Throwable t) log_info(logMsg) log_info(logMsg, java.lang.Throwable t) log_warn(logMsg) log_warn(logMsg, java.lang.Throwable t) log(logMsg) logError(logMsg) Raise errors and warnings error(grp, key) error(grp, key, params) setWarning(warnGrpVal, warnKeyVal, warnparams) Yes/No/Cancel dialog yncerror(grp, java.lang.String key) yncerror(grp, java.lang.String key, params) yncuserinput() Integration httpget(url) httpget(url, user, pass) httpgetasbytes(url, user, pass) httppost(url, data) httppost(url, user, pass, data) httppostasbytes(url, user, pass, byte[] data) invokeChannel(channelName) invokeEndpoint(endPointName, metaData, byte[] data) invokeEndpoint(endPointName, metaData, data) wsinteraction(interactionName) raiseSkipTransaction() Invoke scripts and workflows invokeScript(scriptName) invokeScript(scriptName, context) invokeWorkflow(wfName) Other methods getMbo() getMboName() getScriptName() getProperty(propName)
December 26, 2019
Maximo 7.6 Scripting
Maximo 76 Scripting Features guide is a great source of information but it has been released only in PDF format so it’s poorly indexed by Google. I have split it in small articles and shared here in order to be easily searched over the internet. Library Scripts Warnings and Errors Yes/No/Cancel dialog Before Save, After Save, After Commit Controlling Mbo duplicate CanDelete/CanAdd Object Launch Point Cron Tasks Validation of non-persistent MBOs The mbo.add() method MMI - Maximo Management Interface
November 15, 2019
Maximo Scripting - Before Save, After Save, After Commit
This post is an excerpt from the Maximo 76 Scripting Features guide. Maximo 7.5 scripting supported only the “Before Save” events in the Object Launchpoint. Although that is the most common place where we do customizations, we often see the need to attach some customizations at the after save and after commit events - mostly when we are doing some actions that need to be done after the Mbo has been saved or committed. After save is the phase when the Mbo’s sql statement (insert/update/delete) has been fired, but the commit has not happened. After commit stage happens when the Mbo in the transaction has been committed i.e. the database commit has been successfully executed.
November 15, 2019