When implementing business logic in Java code it may be useful to compare the value of an attribute to it’s previous or initial value.This is particularly useful when overriding MboValueAdapter.action() method to validate the new value of an attribute as soon as it changes. Look at how the three values are retrieved in the following […]
Is an MBO change originated by user?
In some cases you are in the middle of an MBO Java code and you need to know if the current method has been triggered by an interactive UI session or by background process like MIF or escalation.This is what you need. boolean isGUI = getUserInfo().isInteractive(); The getUserInfo() method is available on both Mbo and […]
Custom Java Action Class Example
This entry is part of the Maximo Java Development series. In a previous post I have described how create a custom action class using Java. Here is a full example that can help to understand how to navigate objects and set values. package cust.psdi.app.workorder;import java.rmi.RemoteException;import psdi.common.action.ActionCustomClass;import psdi.mbo.MboConstants;import psdi.mbo.MboRemote;import psdi.mbo.MboSetRemote;import psdi.util.MXException;/** * Sets the Workorder description […]
Set a field as required after save
This entry is part of the Maximo Java Development series. You may have noticed that there are some fields that cannot be modified once an object is saved. An example of this behavior is the ASSET.ASSETNUM field. When you create a new asset you can set it’s ID but once you have saved it it […]
Link Parent-Child records in Maximo
In a previous post I have described how to correctly manage a child table in an application using the Application Designer. However, there are better ways of achieving the same goals so I will analyze all the available options to correctly link records in a parent-child relationship. If you are a creating custom objects and […]
Java Logging and Tracing in Maximo
This entry is part of the Maximo Java Development series. A good logging (tracing) is always a lifesaver when you have problems in a production environment. I will never stop telling to my fellow programmers how much is important to fill code with meaningful log calls. Maximo has a good and flexible logging subsystem. This […]
TPAE Java coding standard
This entry is part of the Maximo Java Development series. What is a coding standard and why it is important? A coding standard is a set of guidelines, rules and regulations on how to write code which will help developers quickly read and understand source code conforming to the style as well as helping to […]
Child table in Application Designer
This article is obsolete. Please refer to this one. If you are a creating custom objects and applications in TPAE you may need at some point to create a child table like the Subassemblies in the Assets application. Let’s pretend we have a parent table called TB1 and a child table called TB2. TB1: Parent […]
Custom Java Class for Roles
This entry is part of the Maximo Java Development series. This is just an example of a Maximo role defined with a custom Java class. In this example I have defined a role that can be used to send emails (Communication Template) to the workorder’s supervisor or to the owner group if the supervisor is […]
Reading and updating Mbo’s attributes
This entry is part of the Maximo Java Development series. In this post I have explained how to query and fetch MBOs from the database. In this small article I will show how to get and set the attributes of an Mbo. How to read attributes To read the attributes of an Mbo you can […]