I'm trying to write an Automation Script to update custom CHANGEBY and CHANGEDATE attributes on the METER object. (The code is below.) I have managed to figure out how to get a reference to the Maximo server and obtain the current date, but I'm having trouble finding out who the current user is.
I have found documentation and code samples for TSRM or TAMIT 7.2 which talks about a "scriptHome" variable which is a reference to the current MBO. Unfortunately, it doesn't appear this "built in variable" was included with MBS 7.5, and there is no documentation on what is available to an Automation Script from its execution context.
Specific Question: How can I find out who the current user is?
General Question: What built in variables are available to me?
Thanks for your help!
Here is my Automation Script. Note that it has an Object launch point, and changeBy and changeDate are OUT direction variables bound to my CHANGEBY and CHANGEDATE attributes.
from psdi.security import UserInfo from psdi.server import MXServer maximo = MXServer.getMXServer() userInfo = scriptHome.getUserInfo() changeDate = maximo.getDate() changeBy = userInfo.getUserName()