
Creating an Automation Script End Point in IBM Maximo
- January 27, 2021
- Alex
- No Responses
- January 27, 2021
- Alex
- No Responses
The IBM Maximo Integration Framework offers a wide variety of capabilities for publishing or consuming information to or from external systems. Some of the available methods for communication are:
Once you have the SCRIPT handler, you can use it to register a new End Point in IBM Maximo:
At this point, you have an End Point that calls an Automation Script that has not yet been created. The next step is to define that Automation Script and implement your own logic:
- Flat File Exchange
- XML File Exchange with XSLT Mapping
- Database Table Exchange (both internal and external to Maximo)
- HTTP or SOAP Service Consumption
- Log into IBM Maximo as an administrator
- Navigate to the Integration > End Points application
- Under the More Actions menu, choose the Add/Modify Handlers option
- Click the New Row button a. Handler: SCRIPT b. Consumed by: INTEGRATION c. Handler Class Name: com.ibm.tivoli.maximo.script.ScriptRouterHandler
- Click the OK button

- Log into IBM Maximo as an administrator
- Navigate to the Integration > End Points application
- Click the New End Point button a. End Point: TEST-SCRIPT b. Description: TEST SCRIPT HANDLER END POINT c. Handler: SCRIPT
- After populating the Handler with SCRIPT, a SCRIPT property will appear a. Value: <The name of your Automation Script>, e.g. TEST-SCRIPT
- Click Save

- Log into IBM Maximo as an administrator
- Navigate to the System Configuration > Platform Configuration > Automation Scripts Application
- From the More Actions menu, choose the Create > Script option
- In the ensuing dialog, enter the basic script information: a. Script: TEST-SCRIPT b. Description: TEST AUTOMATION SCRIPT FOR END POINT c. Language: python
- Enter the source code from below and press the Create button

Source Code: # ------------------ # This script will write a message to the file system # and FTP the file to another server for processing. # # Implicit Variables: # INTERFACE - the name of the triggered Publish Channel # requestData - the message payload # # Alex Walter # alex@a3jgroup.com # 21 JAN 2021 # ------------------ from java.io import File from java.io import FileWriter from org.apache.commons.io import FileUtils from org.apache.commons.net.ftp import FTPClient from org.apache.commons.net.ftp import FTPReply from psdi.util.logging import MXLoggerFactory logger = MXLoggerFactory.getLogger('maximo.script.a3jtutorial') if logger.isDebugEnabled(): logger.debug('Starting TEST-SCRIPT script') logger.debug('INTERFACE: ' + str(INTERFACE)) # If the file exists, then delete it and create it new ftpFileName = "C:\Temp\ftpfile.xml" ftpFile = File(ftpFileName) if ftpFile.exists(): ftpFile.delete() ftpFile.createNewFile() # Write the file to disk fileWriter = None try: fileWriter = FileWriter(ftpFile) fileWriter.write(requestData) finally: if fileWriter: fileWriter.close() # Setup FTP variables - usually good idea to create System Properties ftpHostName = "ftp.company.com" ftpUserName = "username" ftpPassword = "password" ftpClient = None fileInput = None try: # Make an FTP connection ftpClient = FTPClient() ftpClient.connect(ftpHostName) reply = ftpClient.getReplyCode() if logger.isDebugEnabled(): logger.debug('ftp reply: ' + str(reply)) if not FTPReply.isPositiveCompletion(reply): if logger.isDebugEnabled(): logger.debug('not a positive ftp reply') ftpClient.disconnect() else: if logger.isDebugEnabled(): logger.debug('positive ftp reply!') # Log into the FTP server if ftpClient.login(ftpUserName, ftpPassword): if logger.isDebugEnabled(): logger.debug('Logged into FTP site') # ftpClient.setFileType(2); fileInput = FileUtils.openInputStream(ftpFile) # Put the file in the default directory ftpClient.storeFile(ftpFileName, fileInput) if logger.isDebugEnabled(): logger.debug('File sent to Server') # Log out ftpClient.logout() if logger.isDebugEnabled(): logger.debug('Logged out of FTP site') finally: if ftpClient: ftpClient.disconnect() if fileInput: fileInput.close()NOTE: If you need help installing this automation script in your IBM Maximo, or have questions with other Maximo CMMS configurations don’t hesitate to reach out! Leave a comment below, or email info@a3jgroup.com
No comment yet, add your voice below!