added intrusive maintenance flow logic

updated headers for nica order request

Added reactor type support to nica checklists. Refactored flow logic to just use NICA_CHECKLISTS table.

added feature flag support

gated Feature Flags menu item to supervisors

removed debug

added auto comment for intr maint flows on reactor log, intr maint flow id to react servs form, and cancel order on unsign reactor log

added exceptions for lamp and tc services, added control to edit flow id on react servs form, added auto-reactor log comment, added cancel order on unsign event

removed debug

modified NicaOrdersServices to use env variables for group resource name

added logic to filter out service flow ids for servics with is_intrusive set to false, modified security group for feature flag menu, added ability to clear intr main flow id to react serv form

removed unused equates
This commit is contained in:
Infineon\StieberD
2025-02-25 09:39:41 -07:00
parent 8f339106bd
commit 9d4ae3c5b3
38 changed files with 8351 additions and 13489 deletions

View File

@ -27,11 +27,13 @@ $Insert SERVICE_SETUP
$Insert REACTOR_EQUATES
$Insert REACTOR_LOG_EQUATES
$Insert NICA_ORDERS_EQUATES
$Insert NICA_ORDERS_CHECKLISTS_EQUATES
$Insert RLIST_EQUATES
Declare function Environment_Services, Database_Services, Error_Services, Logging_Services, Nica_Orders_Services
Declare function Httpclient_Services, SRP_JSON, Reactor_Services, Reactor_Log_Services
Declare function Httpclient_Services, SRP_JSON, Reactor_Services, Reactor_Log_Services, SRP_Array
Declare subroutine Error_Services, Btree.Extract, Database_Services, Logging_Services, Nica_Orders_Services, Delay
Declare subroutine Httpclient_Services, SRP_JSON, Mona_Services, Service_Services
Declare subroutine Httpclient_Services, SRP_JSON, Mona_Services, Service_Services, Extract_SI_Keys
Machine = Environment_Services('GetServer')
LogDate = Oconv(Date(), 'D4/')
@ -49,6 +51,7 @@ 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_STATUSES = 'new','creating','not-started','in-progress','cancelled','done'
Options REACTOR_TYPES = 'ASM','ASM+','HTR','EPP'
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SERVICES
@ -101,7 +104,7 @@ End Service
Service GetOrderUpdates()
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
Lock hSysLists, ServiceKeyID then
ActiveOrderIds = Nica_Orders_Services('GetActiveOrders')
@ -117,7 +120,6 @@ end service
Service UpdateNicaFlags()
rv = ''
ErrCode = ''
ReactNos = Reactor_Services('GetReactorNumbers')
Open 'REACTOR' to hReactor then
@ -125,6 +127,7 @@ Service UpdateNicaFlags()
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 '')
Open 'REACTOR' to hReactor then
ReadV CacheProveInActive from hReactor, ReactNo, REACTOR_PROVE_IN_ACTIVE$ then
If CacheProveInActive NE ProveInActive then
@ -142,6 +145,14 @@ Service UpdateNicaFlags()
end
end
end
ReadV CacheIntrMaintChecklistActive from hReactor, ReactNo, REACTOR_INTRUSIVE_MAINT_CHECKLIST_ACTIVE$ then
If CacheIntrMaintChecklistActive NE IntrMaintChecklistActive then
Lock hReactor, ReactNo then
WriteV IntrMaintChecklistActive on hReactor, ReactNo, REACTOR_INTRUSIVE_MAINT_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]
@ -171,7 +182,7 @@ Service GetActiveOrders(EntityType=ENTITY_TYPES, EntityId, OrderTypes=ORDER_TYPE
end service
Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES)
Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES, OrderFlows)
ErrorMsg = ''
EntityTypes = 'REACTOR,REACTOR_LOG'
@ -209,7 +220,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$ then
If ( (OrderTypeAlreadyActive EQ False$) or (OrderType EQ 'INTRUSIVE_MAINT') ) then
Begin Case
Case EntityType EQ 'REACTOR'
@ -219,84 +230,159 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES)
ReactNo = Xlate(EntityType, EntityID, REACTOR_LOG_REACTOR$, 'X')
End Case
// Call the API
NicaURL = Environment_Services("GetProveInApiUrl"):'/checklists?'
NicaURL := 'checklistType=':OrderType
NicaURL := '&reactorNumber=':ReactNo
Retries = 3
BackoffSeconds = 1
IsSuccessful = False$
OrderId = ''
Loop
while (IsSuccessful EQ False$ and Retries GT 0)
WaitSeconds = (3 - retries) * BackoffSeconds
Delay(WaitSeconds)
Retries = Retries - 1
HttpResponseJson = Httpclient_Services('SendHTTPRequest', 'POST', NicaURL, 'Accept':@VM:'*/*', '', '', '', False$, False$, '', IgnoreCertErrors)
If HttpResponseJson NE '' then
ObjResponseJson = ''
If SRP_JSON(ObjResponseJson, 'Parse', HttpResponseJson) EQ '' then
OrderId = SRP_JSON(ObjResponseJson, 'GetValue', 'id')
If OrderId NE '' then
Convert @Lower.Case to @Upper.Case in OrderId
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')
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
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
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
Database_Services('WriteDataRow', 'NICA_ORDERS', OrderId, NicaOrderRec, True$, False$, False$)
If Error_Services('NoError') then
If ( (OrderType _EQC 'INITIATE_IDLE') and (EntityType _EQC 'REACTOR') ) then
Open 'REACTOR' to hReactor then
WriteV True$ to hReactor, ReactNo, REACTOR_IDLE_STARTUP_REQUIRED$ else
ErrorMsg = 'Error in ':Service:' service. Error setting IDLE_STARTUP_REQUIRED flag in REACTOR record.'
end
end
// Build request
Body = ''
NewSortedChecklistIds = ''
If OrderType NE 'INTRUSIVE_MAINT' then
// Original API endpoint just uses query params, no body.
NicaURL = Environment_Services("GetProveInApiUrl"):'/checklists?'
NicaURL := 'checklistType=':OrderType
NicaURL := '&reactorNumber=':ReactNo
end else
// 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
If ErrorMsg EQ '' then
IsSuccessful = True$
Response = OrderId
end
end else
ErrorMsg = Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. Null OrderId returned from MesaProveInAPI.'
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. Error parsing JSON response from MesaProveInAPI.'
ErrorMsg = 'Error in ':Service:' service. Failed to initialize JSON object for request body.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null JSON response returned from MesaProveInAPI.'
ErrorMsg = 'Error in ':Service:' service. Null Orderflows variable passed in.'
end
SRP_JSON(ObjResponseJson, 'Release')
Repeat
If Environment_Services('IsProd') then
MonAResource = 'GRP_OPENINSIGHT_MES_OP_FE_MESAPROVEINAPI'
end else
MonAResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_MESAPROVEINAPI_DEV'
end
// Send the request
IsSuccessful = False$
If ErrorMsg EQ '' then
Retries = 3
BackoffSeconds = 1
OrderId = ''
Loop
while (IsSuccessful EQ False$ and Retries GT 0)
WaitSeconds = (3 - retries) * BackoffSeconds
Delay(WaitSeconds)
Retries = Retries - 1
If Body NE '' then
Headers = 'Content-Type':@VM:'application/json':@FM:'Accept':@VM:'*/*'
end else
Headers = 'Accept':@VM:'*/*'
end
HttpResponseJson = Httpclient_Services('SendHTTPRequest', 'POST', NicaURL, Headers, Body, '', '', False$, False$, '', IgnoreCertErrors)
If HttpResponseJson NE '' then
ObjResponseJson = ''
If SRP_JSON(ObjResponseJson, 'Parse', HttpResponseJson) EQ '' then
OrderId = SRP_JSON(ObjResponseJson, 'GetValue', 'id')
If OrderId NE '' then
Convert @Lower.Case to @Upper.Case in OrderId
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')
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
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
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
Database_Services('WriteDataRow', 'NICA_ORDERS', OrderId, NicaOrderRec, True$, False$, False$)
If Error_Services('NoError') then
If ( (OrderType _EQC 'INITIATE_IDLE') and (EntityType _EQC 'REACTOR') ) then
Open 'REACTOR' to hReactor then
WriteV True$ to hReactor, ReactNo, REACTOR_IDLE_STARTUP_REQUIRED$ else
ErrorMsg = 'Error in ':Service:' service. Error setting IDLE_STARTUP_REQUIRED flag in REACTOR record.'
end
end
end
If OrderType _EQC 'INTRUSIVE_MAINT' then
// Create NICA_ORDERS_CHECKLISTS child records for each checklist
If NewSortedChecklistIds NE '' then
For each ChecklistId in NewSortedChecklistIds using @VM
Key = OrderId:'*':ChecklistId
NicaOrdersChecklistsRec = ''
NicaOrdersChecklistsRec<NICA_ORDERS_CHECKLISTS.IS_COMPLETE$> = False$
Database_Services('WriteDataRow', 'NICA_ORDERS_CHECKLISTS', Key, NicaOrdersChecklistsRec, True$, False$, True$)
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
Until (ErrorMsg NE '')
Next ChecklistId
end else
ErrorMsg = 'Error in ':Service:' service. failed to create NICA_ORDERS_CHECKLIST records due to empty checklist array.'
end
end
If ErrorMsg EQ '' then
For each OrderId in CurrActiveOrders using @VM
Nica_Orders_Services('CancelOrder', Orderid)
Next OrderId
IsSuccessful = True$
Response = OrderId
end
end else
ErrorMsg = Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. Null OrderId returned from MesaProveInAPI.'
end
SRP_JSON(ObjResponseJson, 'Release')
end else
ErrorMsg = 'Error in ':Service:' service. Error parsing JSON response from MesaProveInAPI.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null JSON response returned from MesaProveInAPI.'
end
Repeat
end
// Send MonA status
MonaResource = Environment_Services('GetEnvironmentVariable', 'MonaNicaIntegrationServiceGroup')
StatusName = 'CreateNicaOrder'
If IsSuccessful then
LogData = ''
@ -308,7 +394,7 @@ 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
end else
ErrorMsg = 'Error encountered when attempting to create Nica order for entity ':EntityType:' ' :EntityID:' of type ':OrderType:'. Active order already exists.'
end
@ -438,11 +524,7 @@ Service CancelOrder(OrderId)
SRP_JSON(ObjResponseJson, 'Release')
Repeat
If Environment_Services('IsProd') then
MonAResource = 'GRP_OPENINSIGHT_MES_OP_FE_MESAPROVEINAPI'
end else
MonAResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_MESAPROVEINAPI_DEV'
end
MonaResource = Environment_Services('GetEnvironmentVariable', 'MonaNicaIntegrationServiceGroup')
StatusName = 'CancelNicaOrder'
If ( (IsSuccessful EQ True$) and (Response NE 'error') and (ErrorMsg EQ '') ) then
LogData = ''
@ -556,11 +638,8 @@ Service GetOrderStatusUpdate(OrderId)
Loop
while (IsSuccessful EQ False$ and Retries GT 0)
WaitSeconds = (3 - Retries) * BackoffSeconds
Delay(WaitSeconds)
Retries = Retries - 1
HttpResponseJson = Httpclient_Services('SendHTTPRequest', 'GET', ProveInUrl, 'Accept':@VM:'*/*', '', '', '', False$, False$, '', IgnoreCertErrors)
If HttpResponseJson NE '' then
@ -576,15 +655,64 @@ Service GetOrderStatusUpdate(OrderId)
end
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
// Update NICA_ORDERS_CHECKLISTS records (documents)
Open 'NICA_ORDERS_CHECKLISTS' to hNicaOrdersChecklists then
// Parse documents array for their isComplete flag
ObjDocumentArray = SRP_JSON(ObjResponseJson, 'get', 'progresses')
If ObjDocumentArray NE 0 then
NumDocs = SRP_JSON(objDocumentArray, 'GetCount')
For DocIndex = 1 to NumDocs
DocumentId = SRP_JSON(ObjDocumentArray, 'GetValue', '[':DocIndex:'].baseInstructionId', '')
If DocumentId NE '' then
State = SRP_JSON(ObjDocumentArray, 'GetValue', '[':DocIndex:'].state', False$)
IsComplete = (State _EQC 'done')
ChecklistId = ''
Extract_SI_Keys('NICA_CHECKLISTS', 'NICA_BASE_INSTRUCTION_ID', DocumentId, ChecklistId)
ErrorCode = ''
If Not(Get_Status(ErrorCode)) then
If ChecklistId NE '' then
NicaOrdersChecklistsKey = OrderId:'*':ChecklistId
HaveOrderChecklistLock = Database_Services('GetKeyIDLock', 'NICA_ORDERS_CHECKLISTS', NicaOrdersChecklistsKey)
If HaveOrderChecklistLock then
NicaOrdersChecklistsRec = Database_Services('ReadDataRow', 'NICA_ORDERS_CHECKLISTS', NicaOrdersChecklistsKey)
If Error_Services('NoError') then
NicaOrdersChecklistsRec<NICA_ORDERS_CHECKLISTS.IS_COMPLETE$> = IsComplete
NicaOrdersChecklistsRec<NICA_ORDERS_CHECKLISTS.STATE$> = State
Database_Services('WriteDataRow', 'NICA_ORDERS_CHECKLISTS', NicaOrdersChecklistsKey, NicaOrdersChecklistsRec, True$, False$, False$)
If Error_Services('HasError') then
Database_Services('ReleaseKeyIDLock', 'NICA_ORDERS_CHECKLISTS', NicaOrdersChecklistsKey)
end
end
end
end else
ErrorMsg = 'Error in ':Service:' service. No NICA_CHECKLISTS record found for documentId ':DocumentId:'.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Error calling Extract_SI_Keys on NICA_CHECKLISTS table. Error code: ':ErrorCode:'.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null documentId return from Json response.'
end
Next DocIndex
SRP_JSON(ObjDocumentArray, 'Release')
end else
ErrorMsg = 'Error in ':Service:' service. Error retrieving documents array from Json response.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Error opening NICA_ORDERS_CHECKLISTS table.'
end
end
If IsComplete EQ True$ then
OrderType = NicaOrderRec<NICA_ORDERS.ORDER_TYPE$>
If ( (OrderType _EQC 'IDLE') and (EntityType _EQC 'REACTOR') ) then
Open 'REACTOR' to hReactor then
WriteV False$ on hReactor, ReactNo, REACTOR_IDLE_STARTUP_REQUIRED$ else
ErrorMsg = 'Error in ':Service:' service. Error setting IDLE_STARTUP_REQUIRED flag in REACTOR record.'
end
end
end
end
If ErrorMsg EQ '' then Response = True$
end else
Response = False$
@ -594,16 +722,11 @@ Service GetOrderStatusUpdate(OrderId)
ErrorMsg = Error_Services('GetMessage')
end
end
SRP_JSON(ObjResponseJson, 'Release')
end
SRP_JSON(ObjResponseJson, 'Release')
Repeat
If Environment_Services('IsProd') then
MonAResource = 'GRP_OPENINSIGHT_MES_OP_FE_MESAPROVEINAPI'
end else
MonAResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_MESAPROVEINAPI_DEV'
end
MonaResource = Environment_Services('GetEnvironmentVariable', 'MonaNicaIntegrationServiceGroup')
StatusName = 'GetNicaOrderUpdate'
If IsSuccessful and Response NE 'error' then
LogData = ''
@ -641,8 +764,50 @@ Service GetOrderStatusUpdate(OrderId)
end service
Service GetFlowChecklistIds(NicaOrderFlowIds, NicaOrderFlowType=ORDER_TYPES, ReactorTypes=REACTOR_TYPES)
ErrorMsg = ''
FlowChecklistIds = ''
If ( (NicaOrderFlowIds NE '') and (NicaOrderFlowType NE '') and (ReactorTypes NE '') ) then
Query = 'SELECT NICA_CHECKLISTS '
For each NicaOrderFlowId in NicaOrderFlowIds using @VM setting vPos
If vPos GT 1 then Query := 'OR '
Query := 'WITH NICA_ORDER_FLOW_IDS EQ ':Quote(NicaOrderFlowId):' '
Next NicaOrderFlowId
Query := 'AND WITH NICA_ORDER_FLOW_TYPE EQ ':Quote(NicaOrderFlowType):' '
For each ReactorType in ReactorTypes using @VM setting vPos
If vPos EQ 1 then
Query := 'AND '
end else
Query := 'OR '
end
Query := 'WITH REACTOR_TYPES EQ ':Quote(ReactorType):' '
Next ReactorType
Query := 'BY PRIORITY'
RList(Query, TARGET_ACTIVELIST$, '', '', '')
ErrCode = ''
If Not(Get_Status(ErrCode)) then
EOF = False$
Loop
Readnext KeyId else EOF = True$
Until EOF
FlowChecklistIds<0, -1> = KeyId
Repeat
end else
ErrorMsg = 'Error in ':Service:' service. Error calling RList. Error code: ':ErrCode:'.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null NicaOrderFlowIds, NicaOrderFlowType, or ReactorTypes Passed in.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end else
Response = FlowChecklistIds
end
end service
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////