Maximo List Archive

This is an archive of the Maximo Yahoo Community. The content of this pages may be a sometimes obsolete so please check post dates.
Thanks to the community owner Christopher Wanko for providing the content.



Maximo Automation scripting using Jython

From: haiyanchen (2012-05-05 01:07)

Does anyone have good reference about Maximo Jython especially the Maximo methods it can use by itself (not the JAVA class methods it can import and use)?
I googled all over and found some good information from IBM developer works (such as the implicit variables, some Jython examples).
I completed my first Maximo automation script using Jython to populate the changed by user field and change date field which we can not achieve using Maximo configuration. We really do not want to touch Maximo Java classes directly, so I think of using Jython which will tap into Java classes if absolutely necessary.
The application we have is on table PMFORECAST. There are two fields changedate and changedby.
I used two OUT variables chgdate and chgby to bind theme in Automation script.
They are triggered by update to the PMFORECAST newdate field.
The Jython script I drafted and verified working in any locale profile setting in Maximo is like below:
# start
chgby = user
from psdi.server import MXServer
mymaximo = MXServer.getMXServer()
chgdate = mymaximo.getDate()
# end
I like the way I assign the logged on user to the changed by field since this is purely Jython.
I can not figure out a good way to use Jython current date/time to populate the changedate attribute, so I copied and pasted the typical Java method from google result.
My trouble is it is so hard to figure out what are the Jython methods corresponding to the underlying Maximo Java methods. Maximo does not provide an IDE to suggest what objects and methods are available.
Yes I have the Maximo JAVADOC from IBM and can use some methods there by importing the stuff into Jython, but that beat the purpose to simplifying things in Jython instead of repeating the same thing from JAVA.
Any guidance beyond those entry level introduction from the Internet would be highly appreciated and I think will greatly help those who have to use automation scripts.