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.

AttentionIf you are using Maximo or ICD in Version 7.6.x you might not find the “Launch Script” Action. In that case you should read this article to solve this issue first!

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()

To run the script you should hit the following icon in the Taskbar of the Automation Script application:
Selection_042

The result should look as follows:
Selection_043

3 comments

  • May we know if you have any automation script to create Custom ‘Condition’ at Conditional Expression Manager’?

  • I’ve add this

    # Example: Loop over all Users….
    userSet = mxServer.getMboSet(‘MAXUSER’, userInfo)
    #— list only active users add SQL where ————–
    userSet.setWhere (“STATUS = ‘ACTIVE'”)
    # – Run SQL filter
    userSet.reset()

Leave a Reply

Your email address will not be published. Required fields are marked *