This article opens Part 9, the reference. Every correction below was checked against the behaviour of Manage in the MAS 9.2 series, many of them on our test system as well, and each one links to the article of this series that explains it.
How we chose them#
A correction made this list when it has one of two effects:
- The script fails. A method that does not exist, a variable with another name, a sample that does not compile.
- The script runs and does the wrong thing. A check that never fires, a value that never arrives, a write that disappears.
Corrections of wording, history or screenshots did not make the list. The complete list, with the evidence for each statement, is in our member area.
Variables and the service object#
| IBM’s documents say | What Manage does | Article |
|---|---|---|
userInfo exists in every launch point | object, attribute, action and condition launch points do not get it; use mbo.getUserInfo() | 4 |
srcKeys names the fields of the current record | swapped: targetKeys names the current record’s fields | 4 |
the error variable is errorgrp | it is errorgroup; errorgrp raises nothing | 12 |
yncuserinput takes group, key and parameters | it takes no arguments; the documented call fails | 12 |
check for a user session with interaction | the variable is interactive | 12 |
service.isLoggingEnabled() checks the log level | the method does not exist in the 9.2 series | 14 |
| set the autoscript logger to see a script’s output | the script’s own Log Level field decides, and overrides the logger | 14 |
skip costly init work with UIContext.isFromListTab() | that class call fails; ask UIContext.getCurrentContext() | 17 |
Integration#
| IBM’s documents say | What Manage does | Article |
|---|---|---|
import Namespace and Element from org.jdom | Manage 9.2 has org.jdom2; the old import fails | 18 |
set an integer with irData.setCurrentDataAsInt | the method does not exist; use setCurrentData | 18 |
ctx.skipTxn() skips the inbound message | it skips the current noun; the others load | 19 |
ctx.getMsgType() gives the message type | it returns None unless the script set it | 19 |
ctx.processAsAtEnd() adds at the end | the method is processAsAddAtEnd() | 19 |
the endpoint’s SCRIPT property takes the script name | it must be in upper case, or the call fails | 20 |
the HTTP exit sets the URL with req.setUrl | the method is setURL | 20 |
the JMS exit’s responseError handles errors | it is never called in the 9.2 series | 20 |
| the best-practice event filter filters by status | it sets evalresult = True on every path and drops every event | 21 |
REST, workflow and the other types#
| IBM’s documents say | What Manage does | Article |
|---|---|---|
headers in responseHeaders go back to the caller | only content-type is used; the rest is dropped | 22 |
| call the SENDCOMM action with a POST | a plain POST leaves mbo as None; add x-method-override: PATCH | 24 |
the condition sample sets evalresult = true | true fails in Python, and the other branch leaves None | 25 |
the workflow condition class is ...script.CustomCondition | the class is ScriptCustomCondition | 25 |
an async job script gets where | the variable is whereclause | 26 |
an MXERR script mails with sendEmail | the method is sendEMail | 27 |
an attachment store’s deleteAttachment reads the name like createAttachment, and a renamed file gets the topLevelPaths prefix from the script | the name is None on delete, so read urlname from the record; Manage adds the prefix itself, so the script doubles it | 28 |
| warning BMXAA10022W flags several scripts on one event | the check never fires | 31 |
Reading IBM’s pages with this list#
Three habits help with every page, beyond these 25:
- Test the sample before you copy it. Several samples do not compile as printed: wrong
indentation,
=in a test,truein Python. The save refuses them. - Trust names last. Most of the failures above are a name: a variable, a method, a class or a property that differs by one letter or one case.
- Ask what happens when nothing happens. The worst corrections are silent: a check that never fires, a header that is dropped, a variable that stays empty.
What comes next#
Article 34 covers what the script engine does that nobody documented.
IBM’s own pages are the reference to keep next to this series:
- Automation scripts in the IBM Maximo Manage documentation.
- All about Maximo scripting, IBM’s scripting guide on GitHub.
The complete list of corrections, with the evidence for each one, is in our member area. Members get access on request, so get in touch if you want it. If you want help with the scripts in your own Manage, our services page shows how we work.
IBM and Maximo are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide.
