Greetings,
Automation Scripting is a powerful tool in Maximo that can be used to customize the Out Of Box (OOB) behavior of Maximo without the need to deploy any class file which requires downtime of the system. While automation script provides the ability to write code into multiple different languages and their versions like Python, Jython, JavaScript, and Nashhorn, etc. Python/Jython remains the most popular language they use.
One of the most powerful features of Python is the availability of reusable libraries available to achieve many tasks. Many times a requirement need an external library to be called Automation Scripting which can be done much more easily with Maximo 7.6.1.2 onwards.
In this use case, we have written an action script that will be called when the user presses the Test button on the Work Order application.
This automation script contains the logic to call another external file with the name externalPy.py. We create a folder in the application server and place this file into the folder.
The code in externalPy looks like-
Maximo 7.6.1.2 onwards there is a system property "mxe.pylib.path" has been added. The value of this property can be set to the path of this folder.
Below is the code which we use on the action script which will be called when Test button will be clicked on Work Order Tracking application-
In case you have multiple such scripts where you are calling external libraries and if you have to change the path due to some reason, the use of this system property helps to ensure that the new folder path gets updated in one place rather than changing the path into each automation script.
Important to note that the libraries which you are planning to place in this external folder must be compatible with the Python Libraries version available with Maximo.
Hope this post has helped you to get a better understanding of how to call the external libraries or code files using Automation Script and manage them effectively. If yes, then like this blog post and video.
Thanks for the tip. I think u will be able to get the property from ur mxServer.getProperty() method directly
ReplyDeleteHi! i'veconfigured everything as described and i can't execute the external code, could you please help me?
ReplyDelete