Run a Script interactively from ICD/Maximo
The Automation Script application provides the capability to directly run a script without having a launch point defined. This is useful to test some scripting capabilities or to run scripts performing maintenance tasks triggered by an user.
To test this behavior we will create a simple script without a launch point which lists all defined users from the ICD/Maximo system. Important is, that in this scenario no implicit variables are available and you have to initialize your MBO context manually based on the MXServer object. The scripts looks as follows:
#DESCRIPTION:Script to demonstrate usage of Run-Script function from GUI from psdi.server import MXServer from psdi.iface.mic import MicService mxServer = MXServer.getMXServer() micService = MicService(mxServer) micService.init() userInfo = micService.getNewUserInfo() # Example: Loop over all Users.... userSet = mxServer.getMboSet('MAXUSER', userInfo) userMbo = userSet.moveFirst() while (userMbo != None): print "User ",userMbo.getString("USERID") userMbo = userSet.moveNext()