I keep getting a nullpointerexception on the execute method in my demo environments when I try to call it on either an attribute changing or object save. In none of the Maximo, SystemOut, or SystemErr logs does it cover what the nullpointerexception is related to so I'm a bit clueless. I've provided what I think is required based on the documentation below (in python, as we don't use the MBR scripting). Hopefully it works for you.
Initial Script to create Job:
asyncSet=service.getMboSet("ASYNCSCRIPT",mbo.getUserInfo())
asyncMbo=asyncSet.setup()
asyncMbo.setValue("AUTOSCRIPT","EMXTESTSCRIPT")
asyncMbo.setValue("OBJECTNAME","WORKORDER")
asyncMbo.setValue("WHERECLAUSE","workorderid="+str(mbo.getUniqueIDValue()))
asyncSet.execute()
Job Script:
woSet=service.getMboSet("WORKORDER",userInfo)
woSet.setWhere(where)
woSet.reset()
woMbo=woSet.moveFirst()
if woMbo:
woMbo.setValue("DESCRIPTION",woMbo.getString("DESCRIPTION")+ " IT WORKED!")
woSet.save()
woSet.close()
*Edited to fix formatting of code. Apparently code snippet doesn't keep formatting*
------------------------------
Steven Shull
Director of Development
Projetech Inc
Cincinnati OH
------------------------------
Original Message:
Sent: Thu September 10, 2020 07:54 AM
From: User1971
Subject: Working example of asynchronous automation script? (7.6.1.2)
I'm really green when it comes to this stuff. I asked my DBA to test the sample script since I don't have write permissions to MAXASYNCJOB.
My DBA tested the sample script but couldn't get the asynchronous script to fire ... and said "there must be a bug". That answer seemed a bit suspicious to me, so I wondered if there were any other examples out there that we could test.
Thanks.
Original Message:
Sent: Thu September 10, 2020 06:29 AM
From: Diego Visentin
Subject: Working example of asynchronous automation script? (7.6.1.2)
Hi,
the sample reported into documentation doesn't work ?
https://www.ibm.com/support/knowledgecenter/en/SSLKT6_7.6.1.2/com.ibm.mbs.doc/autoscript/t_script_asychronous_job.html
------------------------------
Diego Visentin
EAM BU Director
Tempestive S.p.A.
Pordenone
Original Message:
Sent: Wed September 09, 2020 08:34 PM
From: User1971
Subject: Working example of asynchronous automation script? (7.6.1.2)
Maximo 7.6.1.2:
Does anyone have a working example of an asynchronous automation script?
Example: populate a custom ASSET field behind the scenes - via a process that is slow (something the user would not want to wait for).
https://community.ibm.com/community/user/iot/communities/community-home/digestviewer/viewthread?GroupId=727&MessageKey=256696d7-1948-4215-abbe-3f4f01c65145&CommunityKey=3d7261ae-48f7-481d-b675-a40eb407e0fd&tab=digestviewer&ReturnUrl=%2Fcommunity%2Fuser%2Fibmz-and-linuxone%2Fgroups%2Fcommunity-home%2Fdigestviewer%3Flnk%3Dhm
Thanks.
#Maximo
#AssetandFacilitiesManagement