Tuesday 29 September 2020

Change Status of Child Work Orders or Child Tasks from Parent Work Order using Automation Script || IBM Maximo

 This Automation Script will close all child Task work orders when the Parent work order is closed.

Based on Relationship, We can get Child Work orders or Tasks as we required.

When we are closing the work order if the child is complete. It will close the child WO or Tasks.

Launch Point: Attribute

Object: Workorder

Attribute: Status

Binding Variable: status

Body:

from psdi.server import MXServer

appName = mbo.getThisMboSet().getParentApp()

if appName == "WOTRACK" and status in ('CLOSE') :

    childrenSet = mbo.getMboSet("WOACTIVITYTASK")  #Getting Child Tasks using Relationship

    OSchild = childrenSet.moveFirst()

    while (OSchild):

        if OSchild.getString("STATUS") =='COMP':

            OSchild.changeStatus("CLOSE", MXServer.getMXServer().getDate(), '');

        OSchild = childrenSet.moveNext()



No comments:

Post a Comment