"On Demand Autoscript" is what I call a script that I develop with the intention of being executed from that Execute action. I have written On Demand scripts for doing things like resynchronizing nested workflows or preparing our data for an upgrade. On Demand scripts, though created the same way, are different from what the 7.6 documentation calls "Library scripts" in that, even though Library scripts aren't (necessarily) called from their own Launch Points, the script that calls them does usually provide some context / implicit variables.
An On Demand Autoscript usually looks something like this, which you can look up documentation on in the Maximo API JavaDocs.
from psdi.server import MXServer
server = MXServer.getMXServer()
security = server.lookup("SECURITY")
userInfo = security.getSystemUserInfo()
mboSet = server.getMboSet("SOMEOBJECT", userInfo)
try:
mboSet.setWhere("somecol = 'somevalue'")
mbo = mboSet.moveFirst()
while mbo:
print "do something with mbo %s: %s" % (
mbo.getUniqueIdentifer(), mbo.getString("DESCRIPTION"))
mbo = mboSet.moveNext()
if "applicable":
mboSet.save()
finally:
if not mboSet.isClosed():
mboSet.close()
From the above, it should be plain that you can easily "write a script that loops through records in a table and updates values based on certain criteria. And I can execute it on demand."