Monday 20 April 2015

Throw error in Maximo Automation script

In Maximo, all messages like errors, warnings and info are available in maxmessages table with msgkey and msggroup.

To throw an error in autoscript:

errorgroup=<msggroup>
errorkey=<msgkey>

In case of parameters:
errorgroup=<msggroup>
errorkey=<msgkey>
params=[<param1>,<param2>...etc]

For example I have created an error message in maximo using database administration --> Messages

msggroup = TESTGRP
msgkey = TESTKEY
msgvalue = "This is a test message"

in automation script, it is easy to display error message by using below code:

errorgroup=TESTGRP
errorkey=TESTKEY

in case of params:

For ex: my message value has : msgvalue = "This is a test message by {0}"

errorgroup=TESTGRP
errorkey=TESTKEY
params=[user]


 

2 comments:

Anonymous said...

Hi,

I have created a script and it calls my message box fine.

Although I am trying to set parameters in the text.

I have params=[,] in the script and in the message have {0} and {1} embedded in the script.

However when I trigger the message box, the parameters are not set and I literally see {0} and {1} on the screen instead of the variables values.

Any idea where I am going wrong?

Many thanks,

NJSR said...

what are the parameters defined in params array?
For example: If you want to throw error like "Work Type {0} is not valid for Work Order - {1}."
First define message:
msggroup=TESTWOTYPE
msgkey=WOTYPEVALIDATION
msg="Work Type {0} is not valid for Work Order - {1}."
Second:
In automation script: you can work type by defining variable and bind worktype from workorder. In this example, worktype variable is defined as "wotype" and wonum variable defined as "wo". My workorder number is "W1001" and work type is "CM".
To throw the error, do as below:
errorgroup=TESTWOTYPE
errorkey=WOTYPEVALIDATION
params=[wotype,wo]

Display error will be: Work Type CM is not valid for Work Order - W1001.

Please let me know if it helped to solve your issue.

Maximo SOAPUI error javax.xml.ws.WebServiceException

SOAPUI error while sending payload to below url (in cluster environment) http://localhost:9080/meaweb/services/MXASSET Error : <f...