Pinned topic Document on Automation Script
Could anyone help me with automation script documents. We need to use automation scripts for our project but I couldn't find any documents on automation scripts. Thanks in advance,
tivoli-i lov it 270002R2E789 Posts
vseries 270001Y2YK106 PostsACCEPTED ANSWER
Re: Document on Automation Script2011-12-27T05:08:00Z in response to tivoli-i lov itHi,
Following documents might be helpful for you :-
Service Catalog Jython Validation
SASHULL 270003PYB8177 PostsACCEPTED ANSWER
Re: Document on Automation Script2011-12-27T18:07:13Z in response to expertAttached is a guide provided by IBM that has been invaluable in understanding Automation scripts. This was given in response to one of their webinars (though is also available online).
This is based on Maximo 75 (which I'm assuming is the version you were interested in). There were some slight differences (such as instead of mbo using scriptHome) in TSRM 7.2.
MichaelSmithson 2700035K6J9 PostsACCEPTED ANSWER
Re: Document on Automation Script2012-02-19T06:38:15Z in response to expertHi all,
I am trying to develop an automated script (using python) in IBM Maximo 7.5 which adds a period of time (no. of days) to an existing date. I have 3 attribute fields (existing date, period of time and resultant date), am using an attribute launch point with the period of time as the implicit attribute, and existing date (type IN) and resultant date (type OUT) set as explicit variables. I only need help with how to develop the script itself to unravel and rebuild the dates which I have in the following format: 31/01/2012 16:00 (i.e. 31-Januray, 2012 4pm).
Please can anyone help
MichaelSmithson 2700035K6J9 PostsACCEPTED ANSWER
Re: Document on Automation Script2012-03-26T09:57:42Z in response to MichaelSmithsonI have managed to create the script required.
p = java.util.Date.getTime(purchasedate)
s = java.math.BigInteger.floatValue(p)
s = s / 1000
a = assetdesignlife * 86400
s = s + a
t = time.localtime(s)
designendoflifedate = time.strftime("%d/%m/%Y %H:%M", t)
If only we had had automated scripting in earlier versions of IBM Maximo.
Bowser 2700006MWE79 PostsACCEPTED ANSWER
Re: Document on Automation Script2012-03-27T04:46:12Z in response to MichaelSmithsonSomething useful I found was ignoring documentation on Python / Jython modules and instead referring to the Java and Maximo APIs. This is because the Python / Jython modules are not included in your execution environment, but the Java and Maximo APIs are. You just have to watch for nuances in creating new instances and variable coercion.
That said, I think you should explore using Calendar classes in the Java API. It would make a much cleaner approach to doing the same thing.
You can find the Java APIs here: http://docs.oracle.com/javase/6/docs/api/
scottsd 2000003CK1121 PostsACCEPTED ANSWER
Re: Document on Automation Script2012-04-26T14:01:44Z in response to BowserIt is actually possible to access the Jython/Python modules from these automation scripts with a simple addition to your system's path from an automation sciprt.
Here's an example script. This script assuming my Jython/lib directory on the AppServer is the one shipped within WebSphere, caution is suggested when using this embedded Jython in WebSphere, I've found that it's kinda messed up for some modules, and would recommend instead pointing to a full Jython installation lib directory. In the 188.8.131.52 version of Tpae and going forward, it appears that this directory is automatically included, though, unfortunately in 184.108.40.206 Tpae (and SCCD 7.5) this workaround is still required.
foundJython = False
for path in sys.path:
if (path.find("jython\Lib") != -1) :
print "already found jython in path"
mahato01 270002MM605 PostsACCEPTED ANSWER
Automation script loops around and update all open records2012-10-24T16:21:35Z in response to expertHi,
I am trying to develop a script that will fire on SR and update workorder with set of data. It works but instead of updating the workorder created from SR, it goes on and updates all the workorders. I am not able to get around this on how to limit or control this to update only the workorder that was created from SR. I applied some conditions but that did not work completely.
scriptHome does not work on 7.5? Is there way to get around this problem? Here is a sample of this code.
woQuesAnsSet = mbo.getMboSet("G_ENVQUESANS");
woQuesSet = mbo.getMboSet("G_ENVQUEST");
for i in range(0,woQuesSet .count()):
woQAS = woQuesSet .getMbo(i)
myAns.setValue("G_APP", woQAS.getString("G_APP"), 2L)
myAns.setValue("G_CATEGORY", woQAS.getString("G_CATEGORY"), 2L)
Let me know if you have any suggestion or recommendation on what changes this needs to make it work.
Thanks in advance,
7FF5_David_Brawner 2700057FF51 PostACCEPTED ANSWER
Re: Automation script loops around and update all open records2013-05-13T15:34:17Z in response to mahato01
It doesn't appear from your example that you qualified the WOset, ie. you have not identified the WO you wish to update so the for statement loops through all returned WO's.
Maybe I missed domething in your example code