Calculate Actual Spent Time-Service Request
from psdi.util.logging import MXLoggerfrom psdi.util.logging import MXLoggerFactory
from psdi.mbo import MboConstants
print "CALCSPENTTIME - BEGIN"
#print "Calculate Duration"
#Log for debugging
#logger = MXLoggerFactory.getLogger("maximo.script");
#logger.debug("ScriptName" + launchPoint)
actual_start = mbo.getDate("ACTUALSTART")
actual_finish = mbo.getDate("ACTUALFINISH")
if (actual_start is not None and actual_finish is not None):
actual_duration = (actual_finish.getTime() - actual_start.getTime())/3600000.0
mbo.setValue("ACTDUR", actual_duration,MboConstants.NOACCESSCHECK)
#print "End Calculate Duration"
print "CALCSPENTTIME - END"
No comments:
Post a Comment