The service object has been added in Maximo 7.6 script and is very useful in several scenarios. Here is a list of available methods. For more details refer to this page.
Logging
- getLogger(loggerName)
- log_debug(logMsg)
- log_debug(logMsg, java.lang.Throwable t)
- log_error(logMsg)
- log_error(logMsg, java.lang.Throwable t)
- log_fatal(logMsg)
- log_fatal(logMsg, java.lang.Throwable t)
- log_info(logMsg)
- log_info(logMsg, java.lang.Throwable t)
- log_warn(logMsg)
- log_warn(logMsg, java.lang.Throwable t)
- log(logMsg)
- logError(logMsg)
Raise errors and warnings
- error(grp, key)
- error(grp, key, params)
- setWarning(warnGrpVal, warnKeyVal, warnparams)
Yes/No/Cancel dialog
- yncerror(grp, java.lang.String key)
- yncerror(grp, java.lang.String key, params)
- yncuserinput()
Integration
- httpget(url)
- httpget(url, user, pass)
- httpgetasbytes(url, user, pass)
- httppost(url, data)
- httppost(url, user, pass, data)
- httppostasbytes(url, user, pass, byte[] data)
- invokeChannel(channelName)
- invokeEndpoint(endPointName, metaData, byte[] data)
- invokeEndpoint(endPointName, metaData, data)
- wsinteraction(interactionName)
- raiseSkipTransaction()
Invoke scripts and workflows
- invokeScript(scriptName)
- invokeScript(scriptName, context)
- invokeWorkflow(wfName)
Other methods
- getMbo()
- getMboName()
- getScriptName()
- getProperty(propName)
Service object methods in automation scripts
what import is required in 7.6.1.2 Bruno? I used to use this in slightly older versions with no specific import but one seems required now.
Hi, is there any solution? I have the same problem!
No need for import statement. Just use ‘service’ prefix.
For example:
service.log(“ABCDEF”)
Is there a way to get the response code from httppost or httppostasjson?