Merged PR 13809: ABORT/ALARM Nica Integration

## Background

Currently when a mode change sub mode is an ABORT/ALARM sub mode, operators must refer to an Excel spreadsheet matrix of which paper checklists to complete. This feature is part of an effort to further digitize work instructions and streamline the process of determining which checklists should be completed depending on the reason why a reactor alarmed / aborted.

## Description of Change

NICA_ORDERS_SERVICES (and the NICA Integration Service) now support an order type "ABORT_ALARM", which may be triggered when a reactor mode change occurs and the sub mode contains "ABORT/ALARM". Whether or not a NICA order is created depends on if the NICA checklist defined in OpenInsight applies to that reactor type (EpiPro is excluded for now). The "flows" of checklists to prescribe are defined in the REACT_PROB_CAT records for the ABORT/ALARM sub modes. Furthermore, NICA checklists defined in OpenInsight can now feature a property of whether or not they should _not_ be re-prescribed if a new NICA order is created of the same type while one is already active.

## Testing
- Local testing
- UAT by Jonathon Sperling

## Notes
In the previous NICA integration feature, Intrusive Maintenance, the MonA group resource name was stored in environment variables instead of in ENVIRONMENT_SERVICES. After further testing, this turned out to be an unviable option as environment variables that are picked up are from the user's client or the terminal server they are running OpenInsight from. Setting environment variables on all clients and the terminal servers is not practical, so this was removed in a previous PR.

Related work items: #175188
This commit is contained in:
Stieber Daniel (CSC FI SPS MESLEO)
2025-03-26 22:03:25 +01:00
parent 0716e25303
commit 6050b346a5
11 changed files with 352 additions and 150 deletions

View File

@ -27,11 +27,14 @@ $Insert SERVICE_SETUP
$Insert REACTOR_EQUATES
$Insert REACTOR_LOG_EQUATES
$Insert NICA_ORDERS_EQUATES
$Insert NICA_CHECKLISTS_EQUATES
$Insert NICA_ORDERS_CHECKLISTS_EQUATES
$Insert RLIST_EQUATES
Equ SECONDS_IN_DAY$ to 86400
Declare function Environment_Services, Database_Services, Error_Services, Logging_Services, Nica_Orders_Services
Declare function Httpclient_Services, SRP_JSON, Reactor_Services, Reactor_Log_Services, SRP_Array
Declare function Httpclient_Services, SRP_JSON, Reactor_Services, Reactor_Log_Services, SRP_Array, Datetime
Declare subroutine Error_Services, Btree.Extract, Database_Services, Logging_Services, Nica_Orders_Services, Delay
Declare subroutine Httpclient_Services, SRP_JSON, Mona_Services, Service_Services, Extract_SI_Keys
@ -49,7 +52,7 @@ Return Response or ""
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Options BOOLEAN = True$, False$
Options ENTITY_TYPES = 'REACTOR','REACTOR_LOG'
Options ORDER_TYPES = 'INTRUSIVE_MAINT','CHANGEOVER','INITIATE_IDLE','IDLE','ASM_HTR_TUBE_CHANGE','ASM_HTR_ANNUAL_PM','ASM_HTR_SEMIANNUAL_PM','ASM_HTR_FIVE_AND_TEN_YEAR_PM','IQS_HGCV_ALARM'
Options ORDER_TYPES = 'INTRUSIVE_MAINT','CHANGEOVER','INITIATE_IDLE','IDLE','ASM_HTR_TUBE_CHANGE','ASM_HTR_ANNUAL_PM','ASM_HTR_SEMIANNUAL_PM','ASM_HTR_FIVE_AND_TEN_YEAR_PM','IQS_HGCV_ALARM','ABORT_ALARM'
Options ORDER_STATUSES = 'new','creating','not-started','in-progress','cancelled','done'
Options REACTOR_TYPES = 'ASM','ASM+','HTR','EPP'
@ -125,9 +128,10 @@ Service UpdateNicaFlags()
Open 'REACTOR' to hReactor then
Open 'REACTOR_LOG' to hReactorLog then
For each ReactNo in ReactNos using @FM
ProveInActive = Reactor_Services('GetProveInActive', ReactNo)
HgCVChecklistActive = (Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'IQS_HGCV_ALARM') NE '')
IntrMaintChecklistActive = (Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'INTRUSIVE_MAINT') NE '')
ProveInActive = Reactor_Services('GetProveInActive', ReactNo)
HgCVChecklistActive = (Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'IQS_HGCV_ALARM') NE '')
IntrMaintChecklistActive = (Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'INTRUSIVE_MAINT') NE '')
AbortAlarmChecklistActive = (Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'ABORT_ALARM') NE '')
Open 'REACTOR' to hReactor then
ReadV CacheProveInActive from hReactor, ReactNo, REACTOR_PROVE_IN_ACTIVE$ then
If CacheProveInActive NE ProveInActive then
@ -153,6 +157,14 @@ Service UpdateNicaFlags()
end
end
end
ReadV CacheAbortAlarmChecklistActive from hReactor, ReactNo, REACTOR_ABORT_ALARM_CHECKLIST_ACTIVE$ then
If CacheAbortAlarmChecklistActive NE AbortAlarmChecklistActive then
Lock hReactor, ReactNo then
WriteV AbortAlarmChecklistActive on hReactor, ReactNo, REACTOR_ABORT_ALARM_CHECKLIST_ACTIVE$ else Null
Unlock hReactor, ReactNo else Null
end
end
end
end
CurrModeKey = Xlate('REACTOR_CHILD_KEY_IDS_NG', ReactNo, 'REACT_MODE_KEY_IDS', 'X')
CurrModeKey = CurrModeKey[-1, 'B':@VM]
@ -182,12 +194,12 @@ Service GetActiveOrders(EntityType=ENTITY_TYPES, EntityId, OrderTypes=ORDER_TYPE
end service
Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES, OrderFlows)
Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES, OrderFlows, OrderResponseLevel, ChecklistIds)
ErrorMsg = ''
EntityTypes = 'REACTOR,REACTOR_LOG'
OrderTypes = 'INTRUSIVE_MAINT,CHANGEOVER,INITIATE_IDLE,IDLE,ASM_HTR_TUBE_CHANGE,ASM_HTR_ANNUAL_PM,'
OrderTypes := 'ASM_HTR_SEMIANNUAL_PM,ASM_HTR_FIVE_AND_TEN_YEAR_PM,IQS_HGCV_ALARM'
OrderTypes := 'ASM_HTR_SEMIANNUAL_PM,ASM_HTR_FIVE_AND_TEN_YEAR_PM,IQS_HGCV_ALARM,ABORT_ALARM'
Machine = Environment_Services('GetServer')
Headers = 'Logging DTM' : @FM : 'Machine' : @FM : 'Log'
@ -198,7 +210,7 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
Prod = Environment_Services('IsProd')
IgnoreCertErrors = Not(Prod)
IgnoreCertErrors = Not(Prod)
If ( (EntityType NE '') and (EntityID NE '') and (OrderType NE '') ) then
@ -220,7 +232,7 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
CurrActiveOrders = Nica_Orders_Services('GetActiveOrders', EntityType, EntityID, OrderType)
OrderTypeAlreadyActive = (CurrActiveOrders NE '')
If ( (OrderTypeAlreadyActive EQ False$) or (OrderType EQ 'INTRUSIVE_MAINT') ) then
If ( (OrderTypeAlreadyActive EQ False$) or (OrderType EQ 'INTRUSIVE_MAINT') or (OrderType EQ 'ABORT_ALARM') ) then
Begin Case
Case EntityType EQ 'REACTOR'
@ -233,7 +245,7 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
// Build request
Body = ''
NewSortedChecklistIds = ''
If OrderType NE 'INTRUSIVE_MAINT' then
If ( (OrderType NE 'INTRUSIVE_MAINT') and (OrderType NE 'ABORT_ALARM') ) then
// Original API endpoint just uses query params, no body.
NicaURL = Environment_Services("GetProveInApiUrl"):'/checklists?'
NicaURL := 'checklistType=':OrderType
@ -242,46 +254,71 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
// New API endpoint uses JSON body instead of query params.
NicaURL = Environment_Services("GetProveInApiUrl"):'/order'
If OrderFlows NE '' then
ReactorType = Xlate('REACTOR', ReactNo, REACTOR_REACT_TYPE$, 'X')
NewChecklistIds = Nica_Orders_Services('GetFlowChecklistIds', OrderFlows, OrderType, ReactorType)
// Get incomplete checklists and add them to the new order
If CurrActiveOrders NE '' then
IncompleteChecklistIds = ''
Open 'DICT.NICA_ORDERS_CHECKLISTS' to hDict then
For each ActiveNicaOrdersId in CurrActiveOrders using @VM
IncompleteOrderChecklistIds = ''
Flag = ''
Query = 'NICA_ORDERS_ID':@VM:ActiveNicaOrdersId:@FM
Query := 'IS_COMPLETE':@VM:False$:@FM
Btree.Extract(Query, 'NICA_ORDERS_CHECKLISTS', hDict, IncompleteOrderChecklistIds, 'E', Flag)
If Flag EQ 0 then
IncompleteOrderChecklistIdsRot = SRP_Array('Rotate', IncompleteOrderChecklistIds, @VM, '*')
PrevChecklistIds = IncompleteOrderChecklistIdsRot<0, 2>
Swap '*' with @VM in PrevChecklistIds
IncompleteChecklistIds<0, -1> = PrevChecklistIds
end
Next ActiveNicaOrdersId
If ChecklistIds NE '' then
NewChecklistIds = ChecklistIds
If CurrActiveOrders NE '' then
IncompleteChecklistIds = ''
CompleteChecklistIds = ''
Open 'DICT.NICA_ORDERS_CHECKLISTS' to hDict then
For each ActiveNicaOrdersId in CurrActiveOrders using @VM
// Get incomplete checklists so we can add them to the new order
IncompleteOrderChecklistIds = ''
Flag = ''
Query = 'NICA_ORDERS_ID':@VM:ActiveNicaOrdersId:@FM
Query := 'IS_COMPLETE':@VM:False$:@FM
Btree.Extract(Query, 'NICA_ORDERS_CHECKLISTS', hDict, IncompleteOrderChecklistIds, 'E', Flag)
If Flag EQ 0 then
IncompleteOrderChecklistIdsRot = SRP_Array('Rotate', IncompleteOrderChecklistIds, @VM, '*')
PrevChecklistIds = IncompleteOrderChecklistIdsRot<0, 2>
Swap '*' with @VM in PrevChecklistIds
IncompleteChecklistIds<0, -1> = PrevChecklistIds
end
// Build a list of completed checklists which should not be prescribed again in the replacement NICA order
CompleteOrderChecklistIds = ''
Flag = ''
Query = 'NICA_ORDERS_ID':@VM:ActiveNicaOrdersId:@FM
Query := 'IS_COMPLETE':@VM:True$:@FM
Btree.Extract(Query, 'NICA_ORDERS_CHECKLISTS', hDict, CompleteOrderChecklistIds, 'E', Flag)
If Flag EQ 0 then
CompleteOrderChecklistIdsRot = SRP_Array('Rotate', CompleteOrderChecklistIds, @VM, '*')
CompChecklistIds = CompleteOrderChecklistIdsRot<0, 2>
Swap '*' with @VM in CompChecklistIds
end
For each CompChecklistId in CompChecklistIds using @VM
RemoveIfComp = Xlate('NICA_CHECKLISTS', CompChecklistId, NICA_CHECKLISTS.REMOVE_IF_COMPLETE$, 'X')
If RemoveIfComp then
Locate CompChecklistId in NewChecklistIds using @VM setting vPos then
NewChecklistIds = Delete(NewChecklistIds, 0, vPos, 0)
end
end
Next CompChecklistId
Next ActiveNicaOrdersId
end
NewChecklistIds<0, -1> = IncompleteChecklistIds
end
NewChecklistIds = SRP_Array('Clean', NewChecklistIds, 'TrimAndMakeUnique', @VM)
NewChecklistPriorities = Xlate('NICA_CHECKLISTS', NewChecklistIds, 'PRIORITY', 'X')
ChecklistArray = NewChecklistIds:@FM:NewChecklistPriorities
ChecklistArray = SRP_Array('SortRows', ChecklistArray, 'AR2', 'ARRAY', @FM, @VM)
NewSortedChecklistIds = ChecklistArray<1>
JsonRequest = ''
objJson = ''
If SRP_JSON(objJson, 'New', 'Object') then
SRP_JSON(objJson, 'SetValue', 'orderType', OrderType)
SRP_JSON(objJson, 'SetValue', 'reactorNumber', ReactNo)
NewChecklistInstIds = Xlate('NICA_CHECKLISTS', NewSortedChecklistIds, 'NICA_BASE_INSTRUCTION_ID', 'X')
SRP_JSON(objJson, 'SetValueArray', 'baseInstructionIds', NewChecklistInstIds, @VM)
Body = SRP_JSON(objJson, 'Stringify', 'Styled')
Convert @FM to '' in Body
SRP_JSON(objJson, 'Release')
end else
ErrorMsg = 'Error in ':Service:' service. Failed to initialize JSON object for request body.'
end
NewChecklistIds<0, -1> = IncompleteChecklistIds
end
NewChecklistIds = SRP_Array('Clean', NewChecklistIds, 'TrimAndMakeUnique', @VM)
NewChecklistPriorities = Xlate('NICA_CHECKLISTS', NewChecklistIds, 'PRIORITY', 'X')
ChecklistArray = NewChecklistIds:@FM:NewChecklistPriorities
ChecklistArray = SRP_Array('SortRows', ChecklistArray, 'AR2', 'ARRAY', @FM, @VM)
NewSortedChecklistIds = ChecklistArray<1>
JsonRequest = ''
objJson = ''
If SRP_JSON(objJson, 'New', 'Object') then
SRP_JSON(objJson, 'SetValue', 'orderType', OrderType)
SRP_JSON(objJson, 'SetValue', 'reactorNumber', ReactNo)
NewChecklistInstIds = Xlate('NICA_CHECKLISTS', NewSortedChecklistIds, 'NICA_BASE_INSTRUCTION_ID', 'X')
SRP_JSON(objJson, 'SetValueArray', 'baseInstructionIds', NewChecklistInstIds, @VM)
Body = SRP_JSON(objJson, 'Stringify', 'Styled')
Convert @FM to '' in Body
SRP_JSON(objJson, 'Release')
end else
ErrorMsg = 'Error in ':Service:' service. Failed to initialize JSON object for request body.'
ErrorMsg = 'Error in ':Service:' service. Null ChecklistIds variable passed in.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null Orderflows variable passed in.'
@ -314,24 +351,30 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
OrderId = SRP_JSON(ObjResponseJson, 'GetValue', 'id')
If OrderId NE '' then
Convert @Lower.Case to @Upper.Case in OrderId
ReqDtm = SRP_JSON(ObjResponseJson, 'GetValue', 'requestedDate')
ReqDate = IConv(ReqDtm[1, 'FT'], 'DJ')
ReqTime = IConv(ReqDtm[Col2() + 1, 'F.'], 'MT')
CreatedDtm = ReqDate + (ReqTime/SECONDS_IN_DAY$)
NicaOrderRec = ''
NicaOrderRec<NICA_ORDERS.ORDER_TYPE$> = OrderType
NicaOrderRec<NICA_ORDERS.ORDER_STATUS$> = SRP_JSON(ObjResponseJson, 'GetValue', 'state')
NicaOrderRec<NICA_ORDERS.ENTITY_TYPE$> = EntityType
NicaOrderRec<NICA_ORDERS.ENTITY_ID$> = EntityID
NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'isComplete')
NicaOrderRec<NICA_ORDERS.CREATED_DTM$> = CreatedDtm
If NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> EQ False$ then
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'progressPercentage')
end else
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = 100
end
LogNicaOrderRec = NicaOrderRec
NicaOrderRec<NICA_ORDERS.ORDER_FLOW_IDS$> = OrderFlows
NicaOrderRec<NICA_ORDERS.ORDER_RESPONSE_LEVEL$> = OrderResponseLevel
LogNicaOrderRec = NicaOrderRec
Swap @FM with ',' in LogNicaOrderRec
LogData = ''
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM
LogData<2> = Machine
LogData<3> = 'Nica order record to write: ':LogNicaOrderRec
LogData = ''
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM
LogData<2> = Machine
LogData<3> = 'Nica order record to write: ':LogNicaOrderRec
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
Database_Services('WriteDataRow', 'NICA_ORDERS', OrderId, NicaOrderRec, True$, False$, False$)
@ -342,8 +385,8 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
ErrorMsg = 'Error in ':Service:' service. Error setting IDLE_STARTUP_REQUIRED flag in REACTOR record.'
end
end
end
If OrderType _EQC 'INTRUSIVE_MAINT' then
end
If ( (OrderType _EQC 'INTRUSIVE_MAINT') or (OrderType _EQC 'ABORT_ALARM') ) then
// Create NICA_ORDERS_CHECKLISTS child records for each checklist
If NewSortedChecklistIds NE '' then
For each ChecklistId in NewSortedChecklistIds using @VM
@ -394,10 +437,10 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
end else
ErrorMsg = 'Error encountered when attempting to create Nica in order for reactor ':ReactNo:' of type ':OrderType
Mona_Services('SendBufferedStatus', MonAResource, StatusName, 'Critical')
end
end else
ErrorMsg = 'Error encountered when attempting to create Nica order for entity ':EntityType:' ' :EntityID:' of type ':OrderType:'. Active order already exists.'
end
end
end else
ErrorMsg = 'Error encountered when attempting to create Nica order for entity ':EntityType:' ' :EntityID:' of type ':OrderType:'. Active order already exists.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null EntityType, EntityID, or OrderType passed in.'
@ -492,9 +535,11 @@ Service CancelOrder(OrderId)
If HttpResponseJson NE '' then
ObjResponseJson = ''
If SRP_JSON(ObjResponseJson, 'Parse', HttpResponseJson) EQ '' then
IsComplete = SRP_JSON(ObjResponseJson, 'GetValue', 'pendingUpdate')
IsComplete = SRP_JSON(ObjResponseJson, 'GetValue', 'pendingUpdate')
NicaOrderRec<NICA_ORDERS.ORDER_STATUS$> = SRP_JSON(ObjResponseJson, 'GetValue', 'state')
NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'isComplete')
CloseDtm = Datetime()
NicaOrderRec<NICA_ORDERS.CLOSED_DTM$> = CloseDtm
If IsComplete EQ False$ then
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'progressPercentage')
end else
@ -509,7 +554,18 @@ Service CancelOrder(OrderId)
ErrorMsg = 'Error in ':Service:' service. Error setting IDLE_STARTUP_REQUIRED flag in REACTOR record.'
end
end
end
end
If (OrderType EQ 'ABORT_ALARM') then
ActiveAbortAlarmOrders = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'ABORT_ALARM')
AbortAlarmOrderActive = (ActiveAbortAlarmOrders NE '')
If (AbortAlarmOrderActive EQ False$) then
Open 'REACTOR' to hReactor then
WriteV True$ on hReactor, ReactNo, REACTOR_ABORT_ALARM_COMPLETE$ else
ErrorMsg = 'Error in ':Service:' service. Error setting ABORT_ALARM_COMPLETE flag in REACTOR record.'
end
end
end
end
If ( (Response EQ True$) or (Response EQ False$) ) then IsSuccessful = True$
end else
ErrorMsg = Error_Services('GetMessage')
@ -645,9 +701,15 @@ Service GetOrderStatusUpdate(OrderId)
If HttpResponseJson NE '' then
ObjResponseJson = ''
If SRP_JSON(ObjResponseJson, 'Parse', HttpResponseJson) EQ '' then
IsComplete = SRP_JSON(ObjResponseJson, 'GetValue', 'isComplete')
NicaOrderRec<NICA_ORDERS.ORDER_STATUS$> = SRP_JSON(ObjResponseJson, 'GetValue', 'state')
IsComplete = SRP_JSON(ObjResponseJson, 'GetValue', 'isComplete')
State = SRP_JSON(ObjResponseJson, 'GetValue', 'state')
NicaOrderRec<NICA_ORDERS.ORDER_STATUS$> = State
NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> = IsComplete
CloseDtm = NicaOrderRec<NICA_ORDERS.CLOSED_DTM$>
If ( (CloseDtm EQ '' ) and ( (State _EQC 'done') or (State _EQC 'cancelled') ) ) then
CloseDtm = Datetime()
NicaOrderRec<NICA_ORDERS.CLOSED_DTM$> = CloseDtm
end
If IsComplete EQ False$ then
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'progressPercentage')
end else
@ -656,7 +718,7 @@ Service GetOrderStatusUpdate(OrderId)
Database_Services('WriteDataRow', 'NICA_ORDERS', OrderId, NicaOrderRec, True$, False$, False$)
If Error_Services('NoError') then
OrderType = NicaOrderRec<NICA_ORDERS.ORDER_TYPE$>
If (OrderType _EQC 'INTRUSIVE_MAINT') then
If ( (OrderType _EQC 'INTRUSIVE_MAINT') or (OrderType _EQC 'ABORT_ALARM') ) then
// Update NICA_ORDERS_CHECKLISTS records (documents)
Open 'NICA_ORDERS_CHECKLISTS' to hNicaOrdersChecklists then
// Parse documents array for their isComplete flag
@ -704,7 +766,17 @@ Service GetOrderStatusUpdate(OrderId)
ErrorMsg = 'Error in ':Service:' service. Error opening NICA_ORDERS_CHECKLISTS table.'
end
end
If ( (OrderType _EQC 'ABORT_ALARM') and ( (State _EQC 'done') or (State _EQC 'cancelled') ) ) then
ActiveAbortAlarmOrders = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'ABORT_ALARM')
AbortAlarmOrderActive = (ActiveAbortAlarmOrders NE '')
If (AbortAlarmOrderActive EQ False$) then
Open 'REACTOR' to hReactor then
WriteV True$ on hReactor, ReactNo, REACTOR_ABORT_ALARM_COMPLETE$ else
ErrorMsg = 'Error in ':Service:' service. Error setting ABORT_ALARM_COMPLETE flag in REACTOR record.'
end
end
end
end
If IsComplete EQ True$ then
If ( (OrderType _EQC 'IDLE') and (EntityType _EQC 'REACTOR') ) then
Open 'REACTOR' to hReactor then