Loading...

Creation And Display Of Custom Messages In A Maximo Application

The capability to exhibit a message on the graphical user interface is a common requirement during Maximo application Customizations.
Starting step in this procedure we will have to define the custom message.  We have to open the Database Configuration application and select Messages for the Action menu. we can create a new entry filling the necessary information:
Message Group: Messages can be organized in to groups, so that it will be easy for identifying the entries. For example we can put the name of the customer as the message group, this name convection allows to fastly list all the custom entries.
Message Key:  We have to provide unique ID for the message. This field together with the MSGGROUP uniquely recognizes the message.
Display Method:  Here we can choose either 'MSGBOX' or 'STATUS'. The 'MSGBOX' display a typical popup window exhibits  the message and a set of customizable buttons. The 'STATUS' displays the text above the tool bar and does not require user interference.
Message ID: Provides unique ID of the message. The typical format of custom messages is BMX[CC][NNNN][T] , Here [CC] is the two letters code that identifies your customization, [NNNN] is a four digits number and [T] is the type of message and can be E (Error), W (warning) or I (Info). Maximo suggest to use [CC]='ZZ' for custom messages
Value: Text that will be displayed. Use {N} tags for parameters to be replaced at runtime. Use \n to insert a newline.
Here is a example for New Message for reference

IBM Maximo custom Messages creation


Now we are done with defining the new message in the database, now the next step is to display it. The display technique or logic depends or differs whether we are using AppBean Or a Mbo Class.
If you are in a custom application bean class (extending AppBean) those two Java lines will bring up the custom message box.

String params[] ={"Hi there!"};
clientSession.showMessageBox(
clientSession.getCurrentEvent(), "MyGroup", "HelloMsg", params);

As you can see the {0} tag in the message will be substituted with the string 'sample' described in the params array. Visibly it is possible to define multiple tags.
It is also expected to display this message box when an exception is thrown. For example the following two rows will exhibit the same message but will also log a stacktrace in the system logs.

String params[] ={"Hi there!"};
throw new MXApplicationException("MyGroup", "HelloMsg", params);

If you are in an Mbo or MboSet (businessobject project) we can 'attach' the message to the MboSet with the MboSet.addWarning(MXException e) method.

String params[] ={"Hi there!"};
this.addWarning(new MXApplicationException("MyGroup", "HelloMsg", params));

On the other hand it is possible to throw an MXApplicationException like this.

String[] params = {"Hi there!"};
throw new MXApplicationException("MyGroup", "HelloMsg", params);
Web Services 6060464677476383585

Post a Comment

emo-but-icon

Home item

Blog Archive

Popular Posts

Random Posts

Flickr Photo