Maximo

Maximo-ICON.png

Maximo

Learn how to increase the operational efficiency of the assets you manage, and improve overall equipment effectiveness by using IoT data and AI.

Maximo-ICON.png

TRIRIGA

Reduce the operational costs of the facilities you manage, and create more engaging occupant experiences through the application of IoT data and AI.

Maximo-ICON.png

Engineering

Learn how IoT data and AI are being applied to transform the end-to-end engineering lifecycle.

Expand all | Collapse all

Working example of asynchronous automation script? (7.6.1.2)

  • 1.  Working example of asynchronous automation script? (7.6.1.2)

    Posted Wed September 09, 2020 08:35 PM

    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.



  • 2.  RE: Working example of asynchronous automation script? (7.6.1.2)

    Posted Thu September 10, 2020 06:30 AM
    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
    ------------------------------



  • 3.  RE: Working example of asynchronous automation script? (7.6.1.2)

    Posted Thu September 10, 2020 07:55 AM
    Edited by User1971 Thu September 10, 2020 09:44 AM


  • 4.  RE: Working example of asynchronous automation script? (7.6.1.2)

    Posted Thu September 10, 2020 09:26 AM
    It's not clear to me why you need a DBA to do a direct access to the MAXASYNCJOB table.
    The script in documentation should be used to define an autoscript that launch a second script named TESTASYNC in async way.


    ------------------------------
    Diego Visentin
    EAM BU Director
    Tempestive S.p.A.
    Pordenone
    ------------------------------



  • 5.  RE: Working example of asynchronous automation script? (7.6.1.2)

    Posted Thu September 10, 2020 09:32 AM
    Edited by Steven Shull Thu September 10, 2020 10:24 AM
    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
    ------------------------------