Deprecating old services. Refactored codebase to not use SwapResources GoSub.

This commit is contained in:
Infineon\StieberD
2025-07-01 14:14:04 -07:00
parent b796060529
commit c786fce37b
8 changed files with 100 additions and 2083 deletions

View File

@ -43,6 +43,13 @@ LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
IsProd = Environment_Services('IsProd')
If IsProd EQ True$ then
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_NICAINTEGRATIONSERVICE'
end else
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_NICAINTEGRATIONSERVICE_DEV'
end
GoToService
Return Response or ""
@ -533,7 +540,6 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
end
// Send MonA status
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_NICAINTEGRATIONSERVICE'
StatusName = 'CreateNicaOrder'
If IsSuccessful then
LogData = ''
@ -541,10 +547,10 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES,
LogData<2> = Machine
LogData<3> = 'Successfully created Nica order for entity ':EntityType:' ':EntityID:' of type ':OrderType
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
Mona_Services('PostStatus', MonAResource, StatusName, 'Ok')
Mona_Services('PostStatus', MonaResource, StatusName, 'Ok')
end else
ErrorMsg = 'Error encountered when attempting to create Nica in order for reactor ':ReactNo:' of type ':OrderType
Mona_Services('PostStatus', MonAResource, StatusName, 'Critical')
Mona_Services('PostStatus', MonaResource, StatusName, 'Critical')
end
end
end else
@ -688,7 +694,6 @@ Service CancelOrder(OrderId)
SRP_JSON(ObjResponseJson, 'Release')
Repeat
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_NICAINTEGRATIONSERVICE'
StatusName = 'CancelNicaOrder'
If ( (IsSuccessful EQ True$) and (Response NE 'error') and (ErrorMsg EQ '') ) then
LogData = ''
@ -696,10 +701,10 @@ Service CancelOrder(OrderId)
LogData<2> = Machine
LogData<3> = 'Successfully cancelled Nica order ' : OrderId : ' for reactor ' : ReactNo
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
Mona_Services('PostStatus', MonAResource, StatusName, 'Ok')
Mona_Services('PostStatus', MonaResource, StatusName, 'Ok')
end else
ErrorMsg = 'Error encountered cancelling Nica order ' : OrderId : ' for reactor ' : ReactNo
Mona_Services('PostStatus', MonAResource, StatusName, 'Critical')
Mona_Services('PostStatus', MonaResource, StatusName, 'Critical')
end
end else
ErrorMsg = Error_Services('GetMessage')
@ -906,19 +911,18 @@ Service GetOrderStatusUpdate(OrderId)
end
Repeat
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_NICAINTEGRATIONSERVICE'
StatusName = 'GetNicaOrderUpdate'
If IsSuccessful and Response NE 'error' then
LogData = ''
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM
LogData<2> = Machine
LogData<3> = 'Successfully updated Nica order ':OrderId:' for reactor ':ReactNo:'.'
Mona_Services('PostStatus', MonAResource, StatusName, 'Ok')
Mona_Services('PostStatus', MonaResource, StatusName, 'Ok')
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end else
Database_Services('ReleaseKeyIDLock', 'NICA_ORDERS', OrderId)
ErrorMsg = 'Error encountered updating Nica order ':OrderId:' for reactor ':ReactNo:'.'
Mona_Services('PostStatus', MonAResource, StatusName, 'Critical')
Mona_Services('PostStatus', MonaResource, StatusName, 'Critical')
end
end
end else
@ -1124,7 +1128,6 @@ end service
Service UpdateNicaChecklistBaseInstructionIds()
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_NICAINTEGRATIONSERVICE'
StatusName = Service
StatusState = 'OK'
Machine = Environment_Services('GetServer')