Maximo 6 HOWTO - Obtaining MAXMESSAGE translated and with variables replaced

Hi,

This HOWTO is about how to get a message from MAXMESSAGES translated and with it's variables ({0}) conveniently replaced, since it took me some time doing it I present my solution.

This example is for a class Remotely connected, via RMI, to Maximo. The message being used is the Maximo's welcome message.

(...)
// the mxSession variable has a live session to Maximo.
// the langCode variable has the langcode of the connection.
String msgS = null;
String usrDisplayName[] = { mxSession.getUserInfo().getDisplayName() };
MaxMessage message = new MaxMessage(langCode);
message.setGroup("login");
message.setKey("welcomeusername");
msgS = mxSession.getMessage("login", "welcomeusername");
message.setValue(msgS);
msgS = message.getMessage(usrDisplayName);
(...)

And that's it. Connecting with the wilson user the final msgS string will have 'Welcome, Mike Wilson' string.