diff --git a/LSL2/STPROC/REACTOR_LOG_SERVICES.txt b/LSL2/STPROC/REACTOR_LOG_SERVICES.txt index 40c6328..7e04a7a 100644 --- a/LSL2/STPROC/REACTOR_LOG_SERVICES.txt +++ b/LSL2/STPROC/REACTOR_LOG_SERVICES.txt @@ -203,23 +203,21 @@ Service SignReactorLog(ReactorLogID, UserID) Until TestChar NE @VM or CurServices = '' CurServices[-1,1] = '' Repeat - CCnt = COUNT(CurServices,@VM) + (CurServices NE '') - IntrMaintFeatureFlag = Xlate('FEATURE_FLAGS', 'NICA_INTRUSIVE_MAINTENANCE', FEATURE_FLAGS.ENABLED$, 'X') - If ( (IntrMaintFeatureFlag EQ True$) and (CCnt GT 0) ) then + CCnt = Count(CurServices,@VM) + (CurServices NE '') + If (CCnt GT 0) then IntrMaintFlowCodes = React_Servs_Services('GetIntrMaintFlowIds', CurServices) If IntrMaintFlowCodes NE '' then ReactorType = Xlate('REACTOR', ReactorNo, REACTOR_REACT_TYPE$, 'X') ChecklistIds = Nica_Orders_Services('GetFlowChecklistIds', IntrMaintFlowCodes, 'INTRUSIVE_MAINT', ReactorType) - If ChecklistIds NE '' then - // Create INTRUSIVE_MAINT NICA order - Nica_Orders_Services('CreateNewOrder', 'REACTOR', ReactorNo, 'INTRUSIVE_MAINT', IntrMaintFlowCodes, '', ChecklistIds) - If Error_Services('NoError') then - LogFlows = IntrMaintFlowCodes - Convert @VM to ', ' in LogFlows - Reactor_Log_Services('AddComment', ReactorNo, 'Intrusive Maintenance initiated for flow(s) ':LogFlows:'.', UserID) - end else - ErrorMsg = Error_Services('GetMessage') + If ChecklistIds NE '' then + LogFlows = IntrMaintFlowCodes + Convert @VM to ', ' in LogFlows + Reactor_Log_Services('AddComment', ReactorNo, 'Intrusive Maintenance initiated for flow(s) ':LogFlows:'.', UserID) + IntrMaintFeatureFlag = Xlate('FEATURE_FLAGS', 'NICA_INTRUSIVE_MAINTENANCE', FEATURE_FLAGS.ENABLED$, 'X') + If (IntrMaintFeatureFlag EQ True$) then + Nica_Orders_Services('CreateNewOrder', 'REACTOR', ReactorNo, 'INTRUSIVE_MAINT', IntrMaintFlowCodes, '', ChecklistIds) end + If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage') end end end