Alarm trigger with NICA_ORDERS table
solution tested and ready for deployment updated SRP_Git_Services to handle creating local copies of inherited entities updated HgCV OCAP order trigger to also look for active prove-in orders moved error services common into sysprog to avoid compilation issues
This commit is contained in:
@ -59,8 +59,9 @@ $Insert WO_MAT_QA_EQUATES
|
||||
Equ WOCust$ to 2
|
||||
Equ Comma$ to ','
|
||||
|
||||
Declare function Error_Services, Database_Services, Logging_Services, Environment_Services
|
||||
Declare function Error_Services, Database_Services, Logging_Services, Environment_Services, Nica_Orders_Services
|
||||
Declare subroutine Error_Services, Database_Services, Logging_Services, Set_Status, Reactor_Log_Services, Rds_Services
|
||||
Declare subroutine Nica_Orders_Services
|
||||
|
||||
If KeyID then GoSub Initialize_System_Variables
|
||||
|
||||
@ -100,10 +101,6 @@ CalculateColumn:
|
||||
|
||||
// Make sure the ActionFlow return variable is cleared in case nothing is calculated.
|
||||
ActionFlow = ''
|
||||
|
||||
* Begin Case
|
||||
* Case CalcColName EQ 'ROTR_ACTION' ; GoSub ROTR_ACTION
|
||||
* End Case
|
||||
|
||||
return
|
||||
|
||||
@ -234,18 +231,18 @@ WRITE_RECORD:
|
||||
If (FiveYearAdded or TenYearAdded) then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_FIVE_AND_TEN_YEAR_PM')
|
||||
Nica_Orders_Services('CreateNewOrder', 'REACTOR_LOG', Name, 'ASM_HTR_FIVE_AND_TEN_YEAR_PM')
|
||||
end
|
||||
end
|
||||
|
||||
If (FiveYearRemoved or TenYearRemoved) then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_FIVE_AND_TEN_YEAR_PM' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
OrderIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', Name, 'ASM_HTR_FIVE_AND_TEN_YEAR_PM')
|
||||
If OrderIds NE '' then
|
||||
For each OrderId in OrderIds
|
||||
Nica_Orders_Services('CancelOrder', OrderId)
|
||||
Next OrderId
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -253,57 +250,57 @@ WRITE_RECORD:
|
||||
If (AsmTubeChangeAdded or HtrTubeChangeAdded) then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_TUBE_CHANGE')
|
||||
Nica_Orders_Services('CreateNewOrder', 'REACTOR_LOG', Name, 'ASM_HTR_TUBE_CHANGE')
|
||||
end
|
||||
end
|
||||
|
||||
If (AsmTubeChangeRemoved or HtrTubeChangeRemoved) then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_TUBE_CHANGE' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
end
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
OrderIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', Name, 'ASM_HTR_TUBE_CHANGE')
|
||||
If OrderIds NE '' then
|
||||
For each OrderId in OrderIds
|
||||
Nica_Orders_Services('CancelOrder', OrderId)
|
||||
Next OrderId
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
If SemiannualAdded then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_SEMIANNUAL_PM')
|
||||
Nica_Orders_Services('CreateNewOrder', 'REACTOR_LOG', Name, 'ASM_HTR_SEMIANNUAL_PM')
|
||||
end
|
||||
end
|
||||
|
||||
If SemiannualRemoved then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_SEMIANNUAL_PM' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
end
|
||||
OrderIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', Name, 'ASM_HTR_SEMIANNUAL_PM')
|
||||
If OrderIds NE '' then
|
||||
For each OrderId in OrderIds
|
||||
Nica_Orders_Services('CancelOrder', OrderId)
|
||||
Next OrderId
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
If AnnualAdded then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_ANNUAL_PM')
|
||||
Nica_Orders_Services('CreateNewOrder', 'REACTOR_LOG', Name, 'ASM_HTR_ANNUAL_PM')
|
||||
end
|
||||
end
|
||||
|
||||
If AnnualRemoved then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_ANNUAL_PM' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
end
|
||||
OrderIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', Name, 'ASM_HTR_ANNUAL_PM')
|
||||
If OrderIds NE '' then
|
||||
For each OrderId in OrderIds
|
||||
Nica_Orders_Services('CancelOrder', OrderId)
|
||||
Next OrderId
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -379,3 +376,4 @@ Restore_System_Variables:
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user