- Image by jacobdotcosta via Flickr
Although Maximo (IBM Tivoli) 7 allows much customization to be done using the applications own mechanisms such as Domains, Conditional Expression Manager, etc there are still some situations which require the use of custom classes. In this post I’ll describe how to use custom classes for Attributes (aka FLDs) in Maximo.
Class Inheritance
The definition of custom classes in Maximo start at the Database Configuration application. Here one can check out either if a specific attribute has a custom class associated or not. This information is stored on the MAXATTRIBUTESCFG database table.
Unlike MBOs which always have a class associated, attributes may have none.
When you come to the point where you need to add you own customization, if the attribute already has a class associated you only need to extend that class and add your custom code.
If you want to customize an attribute that has no class associated you have several base classes points available depending on what you want your FLD to do. The starting point in the FLD inheritance hierarchy is the psdi.mbo.MboValueAdapter class. This is the class you’ll use for standard actions, validations and business rules . If you check the Javadocs you can see that this class is already a superclass for quite a number of classes such as Domain specific classes, application specific classes, etc.
Either way you should always call for the super method in your customization in order to keep the existing functionality.
Methods
The two main methods for an FLD are validate() and action(). They’re have similar method signatures, taking no parameters and throwing psdi.util.MXException and java.rmi.RemoteException. They should be used however for 2 different tasks.
validate()
Validate should be used to check the data introduced in the attribute. You may need to check values on other fields or obtain related data from other MBOs. All errors found during data validation should be managed using exceptions, usually psdi.util.MXApplicationException which extends psdi.util.MXException.
No actions should be launched in this method. By actions I mean for instance modifying the value of another field, this should be left to be done in the action() method.
The validate() method will be called prior to the action() method.
action()
This method will only be called if the data was successfully validated. Here is the place where all the actions should be performed, such as calculating values for other fields, etc.
Creating Classes
If you’d like some kind of automation when it comes to generating code for FLDs, and other Maximo objects, you can check out my Maximo Framework project. Maximo Framework is an OSS project for generating class code for IBM Maximo, hosted at Google Code. It contains a Maven Plugin that generates code for MBO, FLDs, CRONTASKSs, etc.
Related articles by Zemanta
- Beans in Maximo (openmaximo.wordpress.com)
- Extending Maximo 7 Business Objects (maximotimes.com)
[…] This post was mentioned on Twitter by Antonio Jacob Costa, openmaximo.net. openmaximo.net said: Creating an Attribute customization using custom classes in #Maximo « openmaximo http://bit.ly/bU3Ct9 #ibm #tivoli #mam […]
By: Tweets that mention Creating an Attribute customization using custom classes in Maximo « openmaximo -- Topsy.com on 09/04/2010
at 10:41
[…] by WP Greet Box WordPress PluginHere is another Maximo blog called openmaximo. His recent post on Creating an Attribute customization using custom classes in Maximo is great at explaining what the methods do when extending MBO’s. Related Posts:Maximo […]
By: Maximo Blog by Antonio Jacob Costa | Maximo Times on 09/04/2010
at 13:44
[…] Creating an Attribute customization using custom classes in Maximo (openmaximo.wordpress.com) […]
By: IBM Tivoli Process Automation Engine (TPAE) « openmaximo on 12/04/2010
at 12:19
[…] Creating an Attribute customization using custom classes in Maximo (openmaximo.wordpress.com) […]
By: Virtual Beans « openmaximo on 05/11/2010
at 21:58
Hello,
If you can help me with this please, I need to know how I can use actions in Maximo to delete certain Asset Attribute values (I have managed using escalations and actions but it will delete all the attributes that are associated with the asset, nevertheless, I need to be able to select.
By: khozama on 16/05/2011
at 16:32