Technical Blog Post
Automated Scripting: Accessing a Custom [J|P]ython Module Within Your Script
In this quick blog we'll discuss how to access a custom module from an automation script. Often in the script application we create long and complicated scripts which are embedded inside a multiline textbox. Maintaining the bulk of your scripts on your file system will allow code modularity as well as allow for maintenance and deployment via an scm system such as RTC or git.
On our system we will place a simple file called test.py under C:\myLibrary with the contents:
In the Maximo Autoscripts application, assume that we've created an Object LP script which will update the description upon save with the following code:
Above we've used sys.path.append() function to make the custom library available to the script environment. No reboot should be required.
After saving our record, we've updated the description with the value from our custom library.
Thanks for reading!