Do you have any idea why my automation script would prevent the work order's status change from entering a record in the WOSTATUS table? The history flag on cancelled work is also not changing when the change is triggered by the CAN status.
I am trying to automatically change the asset up/down flag and record downtime history for a work order's asset for our EM work types. Everything works, but when the change is triggered by a status change, the work order reflects the new status, but there is no COMP record in the WOSTATUS table.
Jython script:
from psdi.mbo import MboSet
ownerMbo = mbo.getOwner()
assetwoset = mbo.getMboSet('RELATEDASSETEM')
countrelated = assetwoset.count()
if vWORKTYPE=="EM" and vSTATUS in('NEW', 'ASSIGNED', 'INPRG', 'READY2WRK', 'REVIEWED', 'INVESTIGATE') and vISRUNNING==1 and vPARENT is None and vHISTORYFLAG==0:
downtimereportset = mbo.getMboSet ('DOWNTIMEREPORT')
downtimereportentry = downtimereportset.add()
downtimereportentry.setValue("isdowntimereport", "0")
downtimereportset.execute()
downtimereportset.save()
elif vWORKTYPE=="EM" and vSTATUS in('WCMP', 'COMP', 'CLOSE', 'CAN') and vISRUNNING==0 and countrelated==0 and vPARENT is None and vHISTORYFLAG==0:
downtimereportset = mbo.getMboSet ('DOWNTIMEREPORT')
downtimereportentry = downtimereportset.add()
downtimereportentry.setValue("isdowntimereport", "0")
downtimereportset.execute()
downtimereportset.save()
#Administration#Assets#Customizations#EverythingMaximo#Reporting------------------------------
Sandy Allred
Northrop Grumman
------------------------------