Added JSON body and response logging to CreateNewOrder service. Modified how reactor log comments are added for ABORT_ALARM NICA orders. Modified ABORT_ALARM solution to not trigger on WAITING_FOR_MAINTENANCE_UNSCHEDULED
This commit is contained in:
@ -2063,7 +2063,12 @@ Service CreateReactModeChange(UserID, ReactNo, Mode, ModeSubCat, ModeText, Force
|
||||
Begin Case
|
||||
Case ( AbortAlarmOrderActive and (SelE10State _EQC 'Productive') )
|
||||
ErrorMsg = "An ABORT/ALARM Checklist is active for this reactor and must be completed or overridden in order to change to a productive state."
|
||||
|
||||
|
||||
Case ( (Mode _EQC 'WAITING_FOR_MAINTENANCE_UNSCHEDULED') and IndexC(ModeSubCat, 'ABORT/ALARM', 1) )
|
||||
// Do not create an ABORT/ALARM NICA order yet as maintenance may determine the appropriate ABORT/ALARM sub mode to be different than
|
||||
// the operator. This avoids creating a NICA order for the wrong flow.
|
||||
CreateAbortAlarmOrder = False$
|
||||
|
||||
Case ( AbortAlarmFromIntrusiveMaintRequired and IndexC(ModeSubCat, 'ABORT/ALARM', 1) and (ModeSubCatFlowId NE '') and (ChecklistIds NE '') )
|
||||
// INTRUSIVE_MAINT FIRST_PRODUCT_RUN_THICK or FIRST_PRODUCT_RUN_HGCV checklist started and
|
||||
// ABORT/ALARM mode entered, so create an ABORT/ALARM order to contain product in reactor.
|
||||
@ -2099,7 +2104,11 @@ Service CreateReactModeChange(UserID, ReactNo, Mode, ModeSubCat, ModeText, Force
|
||||
|
||||
If CreateAbortAlarmOrder then
|
||||
Nica_Orders_Services('CreateNewOrder', 'REACTOR', ReactNo, 'ABORT_ALARM', ModeSubCatFlowId, ModeSubCatRespLvl, ChecklistIds, Intrusive)
|
||||
RlComment = 'ABORT/ALARM initiated for flow ':ModeSubCatFlowId:'.'
|
||||
If Error_Services('HasError') then
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
end else
|
||||
RlComment = 'ABORT/ALARM initiated for flow ':ModeSubCatFlowId:'.'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@ -2171,19 +2180,23 @@ Service CreateReactModeChange(UserID, ReactNo, Mode, ModeSubCat, ModeText, Force
|
||||
EntryId = UserID
|
||||
|
||||
RLRec = ''
|
||||
RLRec<reactor_log_start_date$> = CurDate
|
||||
RLRec<reactor_log_start_time$> = CurTime
|
||||
RLRec<reactor_log_reactor$> = ReactNo
|
||||
if NewModeCategory EQ 'MAINTENANCE' then
|
||||
RLRec<reactor_log_category$> = 'M' ;* for maintenance
|
||||
RLRec<REACTOR_LOG_START_DATE$> = CurDate
|
||||
RLRec<REACTOR_LOG_START_TIME$> = CurTime
|
||||
RLRec<REACTOR_LOG_REACTOR$> = ReactNo
|
||||
If NewModeCategory EQ 'MAINTENANCE' then
|
||||
RLRec<REACTOR_LOG_CATEGORY$> = 'M' ;* for maintenance
|
||||
end
|
||||
RLRec<reactor_log_entry_id$> = UserID
|
||||
RLRec<reactor_log_entry_date$> = CurDate
|
||||
RLRec<reactor_log_react_util_id$> = NewRUKey
|
||||
RLRec<reactor_log_react_prob_cat_id$> = ModeSubCatID
|
||||
|
||||
CurrWoNo = Xlate('CONFIG', 'WO_DAILY_SCHED':ReactNo, 'F2', 'X')
|
||||
CurrWoNo = CurrWoNo[1, 'F ']
|
||||
RLRec<REACTOR_LOG_ENTRY_ID$> = UserID
|
||||
RLRec<REACTOR_LOG_ENTRY_DATE$> = CurDate
|
||||
RLRec<REACTOR_LOG_REACT_UTIL_ID$> = NewRUKey
|
||||
RLRec<REACTOR_LOG_REACT_PROB_CAT_ID$> = ModeSubCatID
|
||||
If (RLComment NE '') then
|
||||
RLRec<REACTOR_LOG_NOTES$> = RLComment
|
||||
RLRec<REACTOR_LOG_NOTES_DTMS$> = CurDate + (CurTime / SECONDS_IN_DAY$)
|
||||
RLRec<REACTOR_LOG_NOTES_USERS$> = UserID
|
||||
end
|
||||
CurrWoNo = Xlate('CONFIG', 'WO_DAILY_SCHED':ReactNo, 'F2', 'X')
|
||||
CurrWoNo = CurrWoNo[1, 'F ']
|
||||
If CurrWoNo NE '' then
|
||||
CurrPSNo = Xlate('WO_LOG', CurrWoNo, 'PS_NO', 'X')
|
||||
end else
|
||||
@ -2292,7 +2305,6 @@ Service CreateReactModeChange(UserID, ReactNo, Mode, ModeSubCat, ModeText, Force
|
||||
// Reopen previous react mode
|
||||
Database_Services('WriteDataRow', 'REACT_MODE_NG', NGPrevModeKey, PrevModeRec)
|
||||
end else
|
||||
If RlComment NE '' then Reactor_Log_Services('AddComment', ReactNo, RlComment, UserID)
|
||||
If SelE10State _EQC 'Productive' then
|
||||
// Reset ABORT/ALARM flag
|
||||
Open 'REACTOR' to hReactor then
|
||||
|
Reference in New Issue
Block a user