pre cutover push
This commit is contained in:
@ -8,7 +8,7 @@ $Insert PM_SPEC_EQUATES
|
||||
$Insert TOOL_EQUATES
|
||||
|
||||
Declare subroutine Database_Services, Error_Services, Set_Status, obj_PM_Spec, Tool_Services, Btree.Extract
|
||||
Declare subroutine Logging_Services, Pm_Services, RList, Obj_Notes
|
||||
Declare subroutine Logging_Services, Pm_Services, RList, Obj_Notes, PM_Spec_Services
|
||||
Declare function Datetime, Database_Services, Error_Services, obj_PM_Spec, obj_Tool, Environment_Services
|
||||
Declare function Logging_Services, Pm_Services, NextKey, SRP_Datetime, Lsl_Users_Services
|
||||
|
||||
@ -18,6 +18,14 @@ LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Tool Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'ToolID' : @FM : 'Notes' : @FM : 'Error'
|
||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Scrubbers\PMCompletion'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Tool Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'ToolID' : @FM : 'Notes' : @FM : 'Message'
|
||||
objLogScrubbers = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
ChangeModes = Database_Services('ReadDataRow', 'APP_INFO', 'QUAL_CHANGE_MODES')
|
||||
@ -36,6 +44,7 @@ Options BOOLEAN = True$, False$
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service StartPM(PMNo, UserID, StartDTM)
|
||||
|
||||
If PMNo NE '' then
|
||||
If UserID EQ '' then UserID = @User4
|
||||
If StartDTM EQ '' then StartDTM = Datetime()
|
||||
@ -84,8 +93,9 @@ Service StartPM(PMNo, UserID, StartDTM)
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
Service CompletePM(PMNo, UserID, CompDTM)
|
||||
|
||||
|
||||
If PMNo NE '' then
|
||||
PMRec = Database_Services('ReadDataRow', 'PM', PMNo)
|
||||
If Error_Services('NoError') then
|
||||
@ -94,7 +104,7 @@ Service CompletePM(PMNo, UserID, CompDTM)
|
||||
If ( (PMSNo NE '') and (ToolID NE '') ) then
|
||||
If UserID EQ '' then UserID = @User4
|
||||
If CompDTM EQ '' then CompDTM = Datetime()
|
||||
ToolCycleCnt = Xlate('PM', PMSNo, 'TOOL_CYCLE_CNT', 'X')
|
||||
ToolCycleCnt = Xlate('PM_SPEC', PMSNo, 'TOOL_CYCLE_CNT', 'X')
|
||||
If ToolCycleCnt EQ '' then ToolCycleCnt = '0'
|
||||
Overdue = False$
|
||||
// Scan for other overdue quals. Only place tool into PROD if all quals are complete.
|
||||
@ -120,7 +130,7 @@ Service CompletePM(PMNo, UserID, CompDTM)
|
||||
If Units = 'D' then Conv = 'D'
|
||||
If Units = 'T' then Conv = 'DT'
|
||||
If Units = 'Q' then Conv = 'MD0'
|
||||
|
||||
|
||||
Now = ''
|
||||
If Units = 'D' then Now = Today
|
||||
If Units = 'T' then Now = CurrDtm
|
||||
@ -190,15 +200,19 @@ Service CompletePM(PMNo, UserID, CompDTM)
|
||||
PMRec<PM_COMP_QTY$> = ToolCycleCnt
|
||||
Database_Services('WriteDataRow', 'PM', PMNo, PMRec, True$, False$, True$)
|
||||
If Error_Services('NoError') then
|
||||
Set_Status(0)
|
||||
ErrCode = ''
|
||||
obj_PM_Spec('SchedNewPM',PMSNo:@RM:OCONV(Date(),'D4'):@RM:OCONV(Time(),'MTS'):@RM:ToolCycleCnt:@RM:PMNo)
|
||||
If Get_Status(ErrCode) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Error calling obj_PM_Spec("SchedNewPM") for '
|
||||
ErrorMsg := 'PM_SPEC ':PMSNo:' and PM ':PMNo:'. Error code: ':ErrCode
|
||||
Error_Services('Add', ErrorMsg)
|
||||
// Update Last PM Comp DTM in PM_SPEC record
|
||||
PM_Spec_Services('UpdatePMCompDtm', PMSNo)
|
||||
If Error_Services('NoError') then
|
||||
Set_Status(0)
|
||||
ErrCode = ''
|
||||
obj_PM_Spec('SchedNewPM',PMSNo:@RM:OCONV(Date(),'D4'):@RM:OCONV(Time(),'MTS'):@RM:ToolCycleCnt:@RM:PMNo)
|
||||
If Get_Status(ErrCode) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Error calling obj_PM_Spec("SchedNewPM") for '
|
||||
ErrorMsg := 'PM_SPEC ':PMSNo:' and PM ':PMNo:'. Error code: ':ErrCode
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Error calling Tool_Services("ChangeToolMode") '
|
||||
ErrorMsg := 'PM ':PMNo:' for PM_SPEC ':PMSNo:' not completed! Error code: ':Error_Services('GetMessage')
|
||||
@ -214,6 +228,7 @@ Service CompletePM(PMNo, UserID, CompDTM)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service CompleteNonToolPM(PMNo, UserID, CurrDTM)
|
||||
|
||||
If PMNo NE '' then
|
||||
@ -224,36 +239,41 @@ Service CompleteNonToolPM(PMNo, UserID, CurrDTM)
|
||||
If Error_Services('NoError') then
|
||||
EarlyStartDTM = IConv(Xlate('PM_SPEC', PMSNo, 'EARLY_START', 'X'), 'DT')
|
||||
If CurrDTM GE EarlyStartDTM then
|
||||
PMRec<PM_START_BY$> = UserID
|
||||
PMRec<PM_START_DTM$> = CurrDTM
|
||||
PMRec<PM_COMP_BY$> = UserID
|
||||
PMRec<PM_COMP_DTM$> = CurrDTM
|
||||
PMRec<PM_COMP_QTY$> = 0
|
||||
Database_Services('WriteDataRow', 'PM', PMNo, PMRec, True$, False$, True$)
|
||||
If Error_Services('NoError') then
|
||||
Set_Status(0)
|
||||
ErrCode = ''
|
||||
obj_PM_Spec('SchedNewPM',PMSNo:@RM:OCONV(Date(),'D4'):@RM:OCONV(Time(),'MTS'):@RM:0:@RM:PMNo)
|
||||
//Pm_Services('ScheduleNextPM', PMSNo, PMNo)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMsg = 'Error in ':Service:' service. Error calling obj_PM_Spec("SchedNewPM") for '
|
||||
ErrorMsg := 'PM_SPEC ':PMSNo:' and PM ':PMNo:'. Error code: ':ErrCode
|
||||
Error_Services('Add', ErrorMsg)
|
||||
PMRec<PM_START_BY$> = UserID
|
||||
PMRec<PM_START_DTM$> = CurrDTM
|
||||
PMRec<PM_COMP_BY$> = UserID
|
||||
PMRec<PM_COMP_DTM$> = CurrDTM
|
||||
PMRec<PM_COMP_QTY$> = 0
|
||||
Database_Services('WriteDataRow', 'PM', PMNo, PMRec, True$, False$, True$)
|
||||
If Error_Services('NoError') then
|
||||
// Update Last PM Comp DTM in PM_SPEC record
|
||||
PM_Spec_Services('UpdatePMCompDtm', PMSNo)
|
||||
If Error_Services('NoError') then
|
||||
Set_Status(0)
|
||||
ErrCode = ''
|
||||
obj_PM_Spec('SchedNewPM',PMSNo:@RM:OCONV(Date(),'D4'):@RM:OCONV(Time(),'MTS'):@RM:0:@RM:PMNo)
|
||||
//Pm_Services('ScheduleNextPM', PMSNo, PMNo)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMsg = 'Error in ':Service:' service. Error calling obj_PM_Spec("SchedNewPM") for '
|
||||
ErrorMsg := 'PM_SPEC ':PMSNo:' and PM ':PMNo:'. Error code: ':ErrCode
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Too early to start PMNo ':PMNo:'.')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service MonitorQuals()
|
||||
|
||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
Open 'TOOL' to hTool then
|
||||
ToolIDs = obj_Tool('KeysByType')
|
||||
For each ToolID in ToolIDs using @VM
|
||||
@ -283,7 +303,7 @@ Service MonitorQuals()
|
||||
If Units = 'D' then Conv = 'D'
|
||||
If Units = 'T' then Conv = 'DT'
|
||||
If Units = 'Q' then Conv = 'MD0'
|
||||
|
||||
|
||||
Now = ''
|
||||
If Units = 'D' then Now = Today
|
||||
If Units = 'T' then Now = CurrDtm
|
||||
@ -486,24 +506,47 @@ Service ProcessQual(PSN, ToolID, CompDtm, Pass)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service Get5SPMs(ShowArchived=BOOLEAN)
|
||||
|
||||
Option = ''
|
||||
Flag = ''
|
||||
keylist = ''
|
||||
Query = ''
|
||||
Open 'DICT.PM_SPEC' to PmsDict then
|
||||
if NOT(ShowArchived) then
|
||||
Query := 'FIVE_S_FLAG':@VM:True$:@FM
|
||||
Query := 'ARCHIVED':@VM:'#1':@FM
|
||||
Query := 'FIVE_S_FLAG':@VM:True$:@FM
|
||||
Query := 'ARCHIVED':@VM:'#1':@FM
|
||||
end else
|
||||
Query := 'FIVE_S_FLAG':@VM:True$:@FM
|
||||
Query := 'FIVE_S_FLAG':@VM:True$:@FM
|
||||
end
|
||||
Btree.Extract(Query, 'PM_SPEC', PmsDict, keylist, '', Flag)
|
||||
end
|
||||
Response = keylist
|
||||
|
||||
end service
|
||||
|
||||
Service GetScrubberPMs(ShowArchived=BOOLEAN)
|
||||
|
||||
Option = ''
|
||||
Flag = ''
|
||||
keylist = ''
|
||||
Query = ''
|
||||
Open 'DICT.PM_SPEC' to PmsDict then
|
||||
if NOT(ShowArchived) then
|
||||
Query := 'PM_CLASS':@VM:'SCRUBBER':@FM
|
||||
Query := 'ARCHIVED':@VM:'#1':@FM
|
||||
end else
|
||||
Query := 'PM_CLASS':@VM:'SCRUBBER':@FM
|
||||
end
|
||||
Btree.Extract(Query, 'PM_SPEC', PmsDict, keylist, '', Flag)
|
||||
end
|
||||
Response = keylist
|
||||
|
||||
end service
|
||||
|
||||
Service ScheduleNextPM(PMSID, PMNo, StartQty)
|
||||
|
||||
//This service is designed to schedule the next PM based on the completion time of the last completion.
|
||||
//Rather than scheduling the next PM based on a set schedule.
|
||||
|
||||
@ -517,50 +560,54 @@ Service ScheduleNextPM(PMSID, PMNo, StartQty)
|
||||
SchedTm = ''
|
||||
SchedQty = ''
|
||||
BEGIN CASE
|
||||
CASE Units = 'D'
|
||||
//SchedDt = CurrDTM + PMSpecRec<PM_SPEC_INTERVAL$> ;* Interval is in days
|
||||
SchedDt = SRP_Datetime('AddDays', CurrDt, Interval)
|
||||
|
||||
CASE Units = 'T'
|
||||
Interval = PMSpecRec<PM_SPEC_INTERVAL$> ;* Interval is in hours
|
||||
Interval = ( Interval/24 ) ;* Convert hours to decimal part of day
|
||||
EarlyStartDelta = PMSpecRec<PM_SPEC_EARLY_START_DELTA$>
|
||||
SchedDTM = CurrDTM + Interval
|
||||
SchedDTM = OCONV(SchedDTM, 'DT/^S')
|
||||
SchedDt = SchedDTM[1,' ']
|
||||
SchedTm = SchedDTM[COL2()+1,' ']
|
||||
SchedDt = ICONV(SchedDt,'D')
|
||||
SchedTm = ICONV(SchedTm,'MT')
|
||||
|
||||
CASE Units = 'Q'
|
||||
// Run-based PM
|
||||
if thisStartQty NE '' then
|
||||
SchedQty = Interval + thisStartQty
|
||||
end else
|
||||
Error_Services('Add', 'Start Qty not supplied to PM_Services -> ScheduleNextPM')
|
||||
end
|
||||
|
||||
|
||||
CASE 1
|
||||
* Missing Units
|
||||
RETURN
|
||||
END CASE
|
||||
if Error_Services('NoError') then
|
||||
PMNo = NextKey('PM') ;* Next PMKey
|
||||
PMRec = ''
|
||||
PMRec<PM_PMS_ID$> = PMSId ;* New PMRec
|
||||
PMrec<PM_ENTER_BY$> = 'AUTO' ;* Automated process user
|
||||
PMRec<PM_ENTER_DTM$> = CurrDTM
|
||||
PMRec<PM_SCHED_DT$> = SchedDt
|
||||
PMRec<PM_SCHED_TM$> = SchedTm
|
||||
PMRec<PM_SCHED_QTY$> = OCONV(SchedQty,'MD0')
|
||||
Database_Services('WriteDataRow', 'PM', PMNo, PMRec)
|
||||
end
|
||||
|
||||
CASE Units = 'D'
|
||||
//SchedDt = CurrDTM + PMSpecRec<PM_SPEC_INTERVAL$> ;* Interval is in days
|
||||
SchedDt = SRP_Datetime('AddDays', CurrDt, Interval)
|
||||
|
||||
CASE Units = 'T'
|
||||
Interval = PMSpecRec<PM_SPEC_INTERVAL$> ;* Interval is in hours
|
||||
Interval = ( Interval/24 ) ;* Convert hours to decimal part of day
|
||||
EarlyStartDelta = PMSpecRec<PM_SPEC_EARLY_START_DELTA$>
|
||||
SchedDTM = CurrDTM + Interval
|
||||
SchedDTM = OCONV(SchedDTM, 'DT/^S')
|
||||
SchedDt = SchedDTM[1,' ']
|
||||
SchedTm = SchedDTM[COL2()+1,' ']
|
||||
SchedDt = ICONV(SchedDt,'D')
|
||||
SchedTm = ICONV(SchedTm,'MT')
|
||||
|
||||
CASE Units = 'Q'
|
||||
// Run-based PM
|
||||
if thisStartQty NE '' then
|
||||
SchedQty = Interval + thisStartQty
|
||||
end else
|
||||
Error_Services('Add', 'Start Qty not supplied to PM_Services -> ScheduleNextPM')
|
||||
end
|
||||
|
||||
Case Units = 'M'
|
||||
//Month based PM
|
||||
SchedDt = SRP_Datetime('AddMonths', CurrDt, Interval)
|
||||
CASE 1
|
||||
* Missing Units
|
||||
RETURN
|
||||
END CASE
|
||||
if Error_Services('NoError') then
|
||||
PMNo = NextKey('PM') ;* Next PMKey
|
||||
PMRec = ''
|
||||
PMRec<PM_PMS_ID$> = PMSId ;* New PMRec
|
||||
PMrec<PM_ENTER_BY$> = 'AUTO' ;* Automated process user
|
||||
PMRec<PM_ENTER_DTM$> = CurrDTM
|
||||
PMRec<PM_SCHED_DT$> = SchedDt
|
||||
PMRec<PM_SCHED_TM$> = SchedTm
|
||||
PMRec<PM_SCHED_QTY$> = OCONV(SchedQty,'MD0')
|
||||
Database_Services('WriteDataRow', 'PM', PMNo, PMRec)
|
||||
end
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service SendPMNotifications()
|
||||
|
||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
EQU COL$PMSKEY TO 1
|
||||
@ -621,9 +668,12 @@ Service SendPMNotifications()
|
||||
Next PMStatus
|
||||
Unlock hSysLists, ServiceKeyID else Null
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetPMStatuses()
|
||||
|
||||
SendEarlyCnt = 0
|
||||
SendDueCnt = 0
|
||||
SendLateCnt = 0
|
||||
@ -654,75 +704,132 @@ Service GetPMStatuses()
|
||||
LateStart = ICONV(obj_PM_Spec('LateStart',PmsKey:@RM:PmsRec), 'DT')
|
||||
Is5S = PmsRec<PM_SPEC_FIVE_S_FLAG$>
|
||||
Units = PmsRec<PM_SPEC_UNITS$>
|
||||
SendEarly = false$
|
||||
SendDue = false$
|
||||
SendLate = false$
|
||||
NotDue = false$
|
||||
SendEarly = false$
|
||||
SendDue = false$
|
||||
SendLate = false$
|
||||
NotDue = false$
|
||||
|
||||
Begin Case
|
||||
Case Units EQ 'D'
|
||||
|
||||
Begin Case
|
||||
Case CurrDt GE EarlyStart AND CurrDt LT DueStart
|
||||
//Send Early Start
|
||||
SendEarly = True$
|
||||
Case CurrDt GE DueStart AND CurrDt LT LateStart
|
||||
//Send Due Start
|
||||
SendDue = True$
|
||||
Case CurrDt GE LateStart
|
||||
//Send Late Start
|
||||
SendLate = True$
|
||||
Case OTHERWISE$
|
||||
NotDue = True$
|
||||
End Case
|
||||
Case Units EQ 'T'
|
||||
|
||||
Begin Case
|
||||
Case CurrDtm GE EarlyStart AND CurrDtm LT DueStart
|
||||
//Send Early Start
|
||||
SendEarly = True$
|
||||
Case CurrDtm GE DueStart AND CurrDtm LT LateStart
|
||||
//Send Due Start
|
||||
SendDue = True$
|
||||
Case CurrDtm GE LateStart
|
||||
//Send Late Start
|
||||
SendLate = True$
|
||||
Case OTHERWISE$
|
||||
NotDue = True$
|
||||
End Case
|
||||
Case Units EQ 'Q'
|
||||
|
||||
End Case
|
||||
|
||||
|
||||
If SendEarly then
|
||||
SendEarlyCnt += 1
|
||||
NotificationSent = CurrPMRec<PM_EARLY_NOTIF_SENT$>
|
||||
DuePMs<-1> = PmsKey : @VM : 'EARLY' : @VM : NotificationSent : @VM : LateStart : @VM : CurrPMId
|
||||
end
|
||||
If SendDue then
|
||||
SendDueCnt += 1
|
||||
NotificationSent = CurrPMRec<PM_DUE_NOTIF_SENT$>
|
||||
DuePMs<-1> = PmsKey : @VM : 'DUE' : @VM: NotificationSent : @VM : LateStart : @VM : CurrPMId
|
||||
end
|
||||
Begin Case
|
||||
Case Units EQ 'D'
|
||||
|
||||
If SendLate then
|
||||
SendLateCnt += 1
|
||||
NotificationSent = CurrPMRec<PM_LATE_NOTIF_SENT$>
|
||||
DuePMs<-1> = PmsKey : @VM : 'LATE' : @VM : NotificationSent : @VM : LateStart : @VM : CurrPMId
|
||||
end
|
||||
If NotDue then
|
||||
DuePMs<-1> = PmsKey : @VM : 'Not Due'
|
||||
end
|
||||
Begin Case
|
||||
Case CurrDt GE EarlyStart AND CurrDt LT DueStart
|
||||
//Send Early Start
|
||||
SendEarly = True$
|
||||
Case CurrDt GE DueStart AND CurrDt LT LateStart
|
||||
//Send Due Start
|
||||
SendDue = True$
|
||||
Case CurrDt GE LateStart
|
||||
//Send Late Start
|
||||
SendLate = True$
|
||||
Case OTHERWISE$
|
||||
NotDue = True$
|
||||
End Case
|
||||
Case Units EQ 'T'
|
||||
|
||||
Begin Case
|
||||
Case CurrDtm GE EarlyStart AND CurrDtm LT DueStart
|
||||
//Send Early Start
|
||||
SendEarly = True$
|
||||
Case CurrDtm GE DueStart AND CurrDtm LT LateStart
|
||||
//Send Due Start
|
||||
SendDue = True$
|
||||
Case CurrDtm GE LateStart
|
||||
//Send Late Start
|
||||
SendLate = True$
|
||||
Case OTHERWISE$
|
||||
NotDue = True$
|
||||
End Case
|
||||
Case Units EQ 'Q'
|
||||
|
||||
End Case
|
||||
|
||||
|
||||
If SendEarly then
|
||||
SendEarlyCnt += 1
|
||||
NotificationSent = CurrPMRec<PM_EARLY_NOTIF_SENT$>
|
||||
DuePMs<-1> = PmsKey : @VM : 'EARLY' : @VM : NotificationSent : @VM : LateStart : @VM : CurrPMId
|
||||
end
|
||||
If SendDue then
|
||||
SendDueCnt += 1
|
||||
NotificationSent = CurrPMRec<PM_DUE_NOTIF_SENT$>
|
||||
DuePMs<-1> = PmsKey : @VM : 'DUE' : @VM: NotificationSent : @VM : LateStart : @VM : CurrPMId
|
||||
end
|
||||
|
||||
If SendLate then
|
||||
SendLateCnt += 1
|
||||
NotificationSent = CurrPMRec<PM_LATE_NOTIF_SENT$>
|
||||
DuePMs<-1> = PmsKey : @VM : 'LATE' : @VM : NotificationSent : @VM : LateStart : @VM : CurrPMId
|
||||
end
|
||||
If NotDue then
|
||||
DuePMs<-1> = PmsKey : @VM : 'Not Due'
|
||||
end
|
||||
Next PmsKey
|
||||
Response = DuePMs
|
||||
|
||||
end service
|
||||
|
||||
Service CompleteScrubberPM(ScrubberID)
|
||||
Option = ''
|
||||
Flag = ''
|
||||
keylist = ''
|
||||
Query = ''
|
||||
Open 'DICT.PM_SPEC' to PmsDict then
|
||||
Query := 'TOOL_ID':@VM:ScrubberID:@FM
|
||||
Btree.Extract(Query, 'PM_SPEC', PmsDict, keylist, '', Flag)
|
||||
end
|
||||
ScrubberPMSpecKeys = keylist
|
||||
If DCOUNT(ScrubberPMSpecKeys, @VM) GT 0 then
|
||||
for each PMSKey in keylist using @VM
|
||||
PMKeys = XLATE('PM_SPEC', PMSKey, 'PM_KEYS', 'X')
|
||||
If DCount(PMKeys, @VM GT 0) then
|
||||
for each PMKey in PMKeys using @VM
|
||||
Pm_Services('CompleteNonToolPM', PMKey, 'SYSTEM', DateTime())
|
||||
If Error_Services('HasError') then
|
||||
ErrMsg = Error_Services('GetMessage')
|
||||
Error_Services('Add', 'Error trying to complete Scrubber PM:' : ErrMsg)
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = ScrubberID
|
||||
LogData<3> = 'Error'
|
||||
LogData<4> = 'PM ' : PMKey : '. ' : ErrMsg
|
||||
Logging_Services('AppendLog', objLogScrubbers, LogData, @RM, @FM)
|
||||
end else
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = ScrubberID
|
||||
LogData<3> = 'Success'
|
||||
LogData<4> = 'PM ' : PMKey : ' Completed successfully'
|
||||
Logging_Services('AppendLog', objLogScrubbers, LogData, @RM, @FM)
|
||||
end
|
||||
Next PMKey
|
||||
end else
|
||||
ErrMsg = 'There were no scheduled PMs for ' : ScrubberID
|
||||
Error_Services('Add', ErrMsg)
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = ScrubberID
|
||||
LogData<3> = 'Error'
|
||||
LogData<4> = ErrMsg
|
||||
Logging_Services('AppendLog', objLogScrubbers, LogData, @RM, @FM)
|
||||
end
|
||||
Next PMSKey
|
||||
end else
|
||||
ErrMsg = 'There were no defined PMs for ' : ScrubberID
|
||||
Error_Services('Add', ErrMsg)
|
||||
|
||||
Error_Services('Add', ErrMsg)
|
||||
LogData = ''
|
||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||
LogData<2> = ScrubberID
|
||||
LogData<3> = 'Error'
|
||||
LogData<4> = ErrMsg
|
||||
Logging_Services('AppendLog', objLogScrubbers, LogData, @RM, @FM)
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user