created transaction queue to process database writes and deletes in first in first out order
This commit is contained in:
@ -30,7 +30,7 @@ Return Response else ''
|
|||||||
|
|
||||||
|
|
||||||
Service RunMonitors()
|
Service RunMonitors()
|
||||||
|
|
||||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||||
Lock hSysLists, ServiceKeyID then
|
Lock hSysLists, ServiceKeyID then
|
||||||
|
|
||||||
@ -52,6 +52,12 @@ Service RunMonitors()
|
|||||||
GoSub ClearCursors
|
GoSub ClearCursors
|
||||||
Mona_Services('SendMetric', 'GRP_OPENINSIGHT_MES_OP_FE_SERVICE_MANANGER', 'PROC_QUEUE', QueueCount)
|
Mona_Services('SendMetric', 'GRP_OPENINSIGHT_MES_OP_FE_SERVICE_MANANGER', 'PROC_QUEUE', QueueCount)
|
||||||
|
|
||||||
|
Query = 'SELECT TRANSACTION_QUEUE'
|
||||||
|
RList(Query, TARGET_ACTIVELIST$, '', '', '')
|
||||||
|
QueueCount = @RecCount
|
||||||
|
GoSub ClearCursors
|
||||||
|
Mona_Services('SendMetric', 'GRP_OPENINSIGHT_MES_OP_FE_SERVICE_MANANGER', 'TRANSACTION_QUEUE', QueueCount)
|
||||||
|
|
||||||
GoSub SAPHeartbeat
|
GoSub SAPHeartbeat
|
||||||
GoSub MonitorMetrologyDirs
|
GoSub MonitorMetrologyDirs
|
||||||
|
|
||||||
|
@ -865,108 +865,20 @@ return
|
|||||||
|
|
||||||
WRITE_RECORD:
|
WRITE_RECORD:
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'WriteRecord'
|
MetricName = 'WriteRecord'
|
||||||
|
|
||||||
WONo = Record<RDS_WO$>
|
|
||||||
|
|
||||||
ReactType = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X')
|
Service_Services('PostProcedure', 'RDS_SERVICES', 'PushSigProfileToWoMat':@VM:Name)
|
||||||
EpiPro = (ReactType EQ 'EPP')
|
|
||||||
GaN = (ReactType EQ 'GAN')
|
|
||||||
NonEpiPro = ( (ReactType NE 'EPP') and (ReactType NE 'GAN') )
|
|
||||||
|
|
||||||
If NonEpiPro then
|
|
||||||
// Sync up VER, LOAD, UNLOAD, POST, and QA signatures with WO_MAT signature profile.
|
|
||||||
// The goal of signature services was to remove any dependency on the WO_MAT signature profile,
|
|
||||||
// however Fabtime relies on this data being replicated to the Scrape SQL DB.
|
|
||||||
WOMatKey = {WO_MAT_KEY}
|
|
||||||
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
|
|
||||||
WOMatSigProf = obj_WO_Mat('CassSigProfile', WOMatKey)
|
|
||||||
WOMatSig = WOMatRec<WO_MAT_SIGNATURE$>
|
|
||||||
WOMatSigDTM = WOMatRec<WO_MAT_SIG_DTM$>
|
|
||||||
|
|
||||||
// Update WO_MAT signature profile to match for the "1VER" stage
|
|
||||||
Stage = '1VER'
|
|
||||||
Locate Stage in WOMatSigProf using @VM setting vPos then
|
|
||||||
WOMatSig<0, vPos> = Record<RDS_PRE_EPI_SIG$>
|
|
||||||
PreEpiDate = Record<RDS_PRE_EPI_SIG_DATE$>
|
|
||||||
If PreEpiDate NE '' then
|
|
||||||
PreEpiTime = Record<RDS_PRE_EPI_SIG_TIME$>
|
|
||||||
PreEpiSigDTM = PreEpiDate + (PreEpiTime/86400)
|
|
||||||
end else
|
|
||||||
PreEpiSigDTM = ''
|
|
||||||
end
|
|
||||||
WOMatSigDTM<0, vPos> = PreEpiSigDTM
|
|
||||||
end
|
|
||||||
|
|
||||||
// Update WO_MAT signature profile to match for "1LOAD" stage
|
|
||||||
Stage = '1LOAD'
|
|
||||||
Locate Stage in WOMatSigProf using @VM setting vPos then
|
|
||||||
WOMatSig<0, vPos> = Record<RDS_OPERATOR_IN$>
|
|
||||||
DateIn = Record<RDS_DATE_IN$>
|
|
||||||
If DateIn NE '' then
|
|
||||||
LoadTime = Record<RDS_TIME_IN$>
|
|
||||||
LoadSigDTM = DateIn + (LoadTime/86400)
|
|
||||||
end else
|
|
||||||
LoadSigDTM = ''
|
|
||||||
end
|
|
||||||
WOMatSigDTM<0, vPos> = LoadSigDTM
|
|
||||||
end
|
|
||||||
|
|
||||||
// Update WO_MAT signature profile to match for the "1UNLOAD" stage
|
|
||||||
Stage = '1UNLOAD'
|
|
||||||
Locate Stage in WOMatSigProf using @VM setting vPos then
|
|
||||||
WOMatSig<0, vPos> = Record<RDS_OPERATOR_OUT$>
|
|
||||||
DateOut = Record<RDS_DATE_OUT$>
|
|
||||||
If DateOut NE '' then
|
|
||||||
TimeOut = Record<RDS_TIME_OUT$>
|
|
||||||
TimeOutSigDTM = DateOut + (TimeOut/86400)
|
|
||||||
end else
|
|
||||||
TimeOutSigDTM = ''
|
|
||||||
end
|
|
||||||
WOMatSigDTM<0, vPos> = TimeOutSigDTM
|
|
||||||
end
|
|
||||||
|
|
||||||
// Update WO_MAT signature profile to match for the "1POST" stage
|
|
||||||
Stage = '1POST'
|
|
||||||
Locate Stage in WOMatSigProf using @VM setting vPos then
|
|
||||||
WOMatSig<0, vPos> = Record<RDS_POST_EPI_SIG$>
|
|
||||||
PostSigDate = Record<RDS_POST_EPI_SIG_DATE$>
|
|
||||||
If PostSigDate NE '' then
|
|
||||||
PostSigTime = Record<RDS_POST_EPI_SIG_TIME$>
|
|
||||||
PostSigDTM = PostSigDate + (PostSigTime/86400)
|
|
||||||
end else
|
|
||||||
PostSigDTM = ''
|
|
||||||
end
|
|
||||||
WOMatSigDTM<0, vPos> = PostSigDTM
|
|
||||||
end
|
|
||||||
|
|
||||||
// Update WO_MAT signature profile to match for the "1QA" stage
|
|
||||||
Stage = '1QA'
|
|
||||||
Locate Stage in WOMatSigProf using @VM setting vPos then
|
|
||||||
WOMatSig<0, vPos> = Record<RDS_SUP_VER_SIG$>
|
|
||||||
FQADate = Record<RDS_SUP_VER_SIG_DATE$>
|
|
||||||
If FQADate NE '' then
|
|
||||||
FQASigTime = Record<RDS_SUP_VER_SIG_TIME$>
|
|
||||||
FQASigDTM = FQADate + (FQASigTime/86400)
|
|
||||||
end else
|
|
||||||
FQASigDTM = ''
|
|
||||||
end
|
|
||||||
WOMatSigDTM<0, vPos> = FQASigDTM
|
|
||||||
end
|
|
||||||
|
|
||||||
WOMatRec<WO_MAT_SIG_PROFILE$> = WOMatSigProf
|
|
||||||
WOMatRec<WO_MAT_SIGNATURE$> = WOMatSig
|
|
||||||
WOMatRec<WO_MAT_SIG_DTM$> = WOMatSigDTM
|
|
||||||
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
|
|
||||||
end
|
|
||||||
|
|
||||||
OrigDateOut = OrigRecord<RDS_DATE_OUT$>
|
OrigDateOut = OrigRecord<RDS_DATE_OUT$>
|
||||||
NewDateOut = Record<RDS_DATE_OUT$>
|
NewDateOut = Record<RDS_DATE_OUT$>
|
||||||
|
|
||||||
If ( ( (OrigDateOut EQ '') and (NewDateOut NE '') ) ) then
|
If ( ( (OrigDateOut EQ '') and (NewDateOut NE '') ) ) then
|
||||||
// Mark this cassette as processed in the schedule event record
|
// Mark this cassette as processed in the schedule event record
|
||||||
|
WONo = Record<RDS_WO$>
|
||||||
DatetimeOut = {DATETIME_OUT}
|
DatetimeOut = {DATETIME_OUT}
|
||||||
|
ReactType = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X')
|
||||||
|
EpiPro = (ReactType EQ 'EPP')
|
||||||
If EpiPro then
|
If EpiPro then
|
||||||
WMIKeys = {WM_IN_KEY}
|
WMIKeys = {WM_IN_KEY}
|
||||||
For each WMIKey in WMIKeys using @VM setting vPos
|
For each WMIKey in WMIKeys using @VM setting vPos
|
||||||
@ -1062,5 +974,3 @@ Restore_System_Variables:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ AutoDisplayErrors = FALSE$ ; // Set this to True$ when debugging so all erro
|
|||||||
Declare subroutine SRP_Stopwatch, Error_Services, obj_Tables, Metrology_Services, obj_RDS_Test, SRP_JSON, Logging_Services
|
Declare subroutine SRP_Stopwatch, Error_Services, obj_Tables, Metrology_Services, obj_RDS_Test, SRP_JSON, Logging_Services
|
||||||
Declare subroutine RTI_Set_Debugger, Database_Services, Btree.Extract, Extract_SI_Keys, Obj_WO_Mat, Obj_WO_Mat_Log
|
Declare subroutine RTI_Set_Debugger, Database_Services, Btree.Extract, Extract_SI_Keys, Obj_WO_Mat, Obj_WO_Mat_Log
|
||||||
Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status , Reactor_Services
|
Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status , Reactor_Services
|
||||||
Declare subroutine Rds_Services, Obj_Post_Log, Mona_Services
|
Declare subroutine Rds_Services, Obj_Post_Log, Mona_Services, Transaction_Services
|
||||||
Declare function SRP_Sort_Array, Metrology_Services, obj_RDS_Test, obj_Test_Point_Map, Database_Services
|
Declare function SRP_Sort_Array, Metrology_Services, obj_RDS_Test, obj_Test_Point_Map, Database_Services
|
||||||
Declare function Work_Order_Services, SRP_JSON, Logging_Services, Environment_Services, SRP_Trim, Error_Services
|
Declare function Work_Order_Services, SRP_JSON, Logging_Services, Environment_Services, SRP_Trim, Error_Services
|
||||||
Declare function Memberof, Obj_WO_Mat, Obj_WO_Mat_Log, SRP_Array, DateTime, Dialog_Box, obj_Prod_Spec
|
Declare function Memberof, Obj_WO_Mat, Obj_WO_Mat_Log, SRP_Array, DateTime, Dialog_Box, obj_Prod_Spec
|
||||||
@ -144,15 +144,12 @@ end
|
|||||||
|
|
||||||
Return Response else ''
|
Return Response else ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Service Parameter Options
|
// Service Parameter Options
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
Options BOOLEAN = True$, False$
|
Options BOOLEAN = True$, False$
|
||||||
Options STAGES = 'PRE', 'FWI', 'LWI', 'QA', 'LOAD', 'UNLOAD'
|
Options STAGES = 'PRE', 'FWI', 'LWI', 'QA', 'LOAD', 'UNLOAD'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Services
|
// Services
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -198,6 +195,7 @@ Service GetCurrentStage(RDSNo)
|
|||||||
|
|
||||||
End Service
|
End Service
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
// GetComments
|
// GetComments
|
||||||
//
|
//
|
||||||
@ -233,6 +231,7 @@ End Service
|
|||||||
// to an RDS record.
|
// to an RDS record.
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
Service AddComment(RDSNo, Comment, UsernameOpt)
|
Service AddComment(RDSNo, Comment, UsernameOpt)
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'AddComment'
|
MetricName = 'AddComment'
|
||||||
|
|
||||||
@ -259,6 +258,7 @@ Service AddComment(RDSNo, Comment, UsernameOpt)
|
|||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
End Service
|
End Service
|
||||||
|
|
||||||
|
|
||||||
@ -297,10 +297,10 @@ Service GetFinalQAStatus(RDSNo)
|
|||||||
|
|
||||||
End Service
|
End Service
|
||||||
|
|
||||||
|
|
||||||
Service IsPackaged(RDSNo, RDSType)
|
Service IsPackaged(RDSNo, RDSType)
|
||||||
|
|
||||||
isPackaged = False$
|
isPackaged = False$
|
||||||
//ReactType = XLATE('RDS', RDSNo, 'REACTOR_TYPE', '')
|
|
||||||
// Check to see if the Final QA signature is in place.
|
// Check to see if the Final QA signature is in place.
|
||||||
If RDSType EQ 'EPP' then
|
If RDSType EQ 'EPP' then
|
||||||
Convert '.' TO '*' in RDSNo
|
Convert '.' TO '*' in RDSNo
|
||||||
@ -323,7 +323,9 @@ Service IsPackaged(RDSNo, RDSType)
|
|||||||
|
|
||||||
End Service
|
End Service
|
||||||
|
|
||||||
|
|
||||||
Service GetHoldStatus(RDSNo, RDSType)
|
Service GetHoldStatus(RDSNo, RDSType)
|
||||||
|
|
||||||
Response = False$
|
Response = False$
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
IF RDSType EQ 'EPP' then
|
IF RDSType EQ 'EPP' then
|
||||||
@ -362,8 +364,7 @@ End Service
|
|||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
Service GetRDSList(WorkOrderNo, KeysOnly=BOOLEAN)
|
Service GetRDSList(WorkOrderNo, KeysOnly=BOOLEAN)
|
||||||
|
|
||||||
RDSList = ''
|
RDSList = ''
|
||||||
|
|
||||||
If WorkOrderNo NE '' then
|
If WorkOrderNo NE '' then
|
||||||
rv = Set_Status(0)
|
rv = Set_Status(0)
|
||||||
RDSKeys = ''
|
RDSKeys = ''
|
||||||
@ -413,8 +414,7 @@ Service GetRDSList(WorkOrderNo, KeysOnly=BOOLEAN)
|
|||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.')
|
Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Response = RDSList
|
Response = RDSList
|
||||||
|
|
||||||
end service
|
end service
|
||||||
@ -432,7 +432,6 @@ end service
|
|||||||
Service GetRDSData(WorkOrderNo, Columns, ShowGasGauge, RDSOverrideList)
|
Service GetRDSData(WorkOrderNo, Columns, ShowGasGauge, RDSOverrideList)
|
||||||
|
|
||||||
RDSList = ''
|
RDSList = ''
|
||||||
|
|
||||||
If ( (WorkOrderNo NE '') or (RDSOverrideList NE '') ) then
|
If ( (WorkOrderNo NE '') or (RDSOverrideList NE '') ) then
|
||||||
If ShowGasGauge NE True$ then ShowGasGauge = False$
|
If ShowGasGauge NE True$ then ShowGasGauge = False$
|
||||||
rv = Set_Status(0)
|
rv = Set_Status(0)
|
||||||
@ -523,6 +522,7 @@ end service
|
|||||||
// <1,2> Column Text Supplement Instructions
|
// <1,2> Column Text Supplement Instructions
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
Service SetSupplement(SupplementList, Username)
|
Service SetSupplement(SupplementList, Username)
|
||||||
|
|
||||||
RDSNotificationListAdd = ''
|
RDSNotificationListAdd = ''
|
||||||
RDSNotificationListRemove = ''
|
RDSNotificationListRemove = ''
|
||||||
Action = ''
|
Action = ''
|
||||||
@ -581,7 +581,7 @@ Service SetSupplement(SupplementList, Username)
|
|||||||
Error_Services('Add', 'SupplementList argument was missing from the ' : Service : ' service.')
|
Error_Services('Add', 'SupplementList argument was missing from the ' : Service : ' service.')
|
||||||
end
|
end
|
||||||
|
|
||||||
* //Now send an email notification
|
// Now send an email notification
|
||||||
IF RDSNotificationListAdd NE '' then
|
IF RDSNotificationListAdd NE '' then
|
||||||
Instructions = XLATE('RDS', RDSNotificationListAdd<1>, RDS_SUPPL_INST$, 'X')
|
Instructions = XLATE('RDS', RDSNotificationListAdd<1>, RDS_SUPPL_INST$, 'X')
|
||||||
PSN = XLATE('RDS', RDSNotificationListAdd<1>, RDS_PROD_SPEC_ID$, 'X')
|
PSN = XLATE('RDS', RDSNotificationListAdd<1>, RDS_PROD_SPEC_ID$, 'X')
|
||||||
@ -637,6 +637,7 @@ Service SetSupplement(SupplementList, Username)
|
|||||||
Parms = Recipients:@RM:SendFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
Parms = Recipients:@RM:SendFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||||
obj_Notes('Create',Parms)
|
obj_Notes('Create',Parms)
|
||||||
end
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -701,6 +702,7 @@ end service
|
|||||||
// Returns True$ if RDS is valid
|
// Returns True$ if RDS is valid
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
Service IsValidRDS(RDSNo, RDSType)
|
Service IsValidRDS(RDSNo, RDSType)
|
||||||
|
|
||||||
IsValid = False$
|
IsValid = False$
|
||||||
FirstChar = RDSNo[1,1]
|
FirstChar = RDSNo[1,1]
|
||||||
*debug
|
*debug
|
||||||
@ -727,12 +729,14 @@ Service IsValidRDS(RDSNo, RDSType)
|
|||||||
End Case
|
End Case
|
||||||
|
|
||||||
Response = IsValid
|
Response = IsValid
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service IsValidSubLot(RDSNo, RDSType, SupplierLot)
|
Service IsValidSubLot(RDSNo, RDSType, SupplierLot)
|
||||||
|
|
||||||
IsValid = False$
|
IsValid = False$
|
||||||
rec = ''
|
rec = ''
|
||||||
*debug
|
|
||||||
Begin Case
|
Begin Case
|
||||||
|
|
||||||
Case RDSType EQ 'SIC'
|
Case RDSType EQ 'SIC'
|
||||||
@ -755,12 +759,14 @@ Service IsValidSubLot(RDSNo, RDSType, SupplierLot)
|
|||||||
IsValid = True$
|
IsValid = True$
|
||||||
end
|
end
|
||||||
|
|
||||||
End Case
|
End Case
|
||||||
|
|
||||||
Response = IsValid
|
Response = IsValid
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service GetRDSRunHistoryByReactorAndWO(ReactorNo, WO)
|
Service GetRDSRunHistoryByReactorAndWO(ReactorNo, WO)
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'GetRDSRunHistoryByReactorAndWO'
|
MetricName = 'GetRDSRunHistoryByReactorAndWO'
|
||||||
|
|
||||||
@ -800,10 +806,12 @@ Service GetRDSRunHistoryByReactorAndWO(ReactorNo, WO)
|
|||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service IsTWLoggingReqd(RDSNo)
|
Service IsTWLoggingReqd(RDSNo)
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'IsTWLoggingReqd'
|
MetricName = 'IsTWLoggingReqd'
|
||||||
|
|
||||||
@ -870,9 +878,12 @@ Service IsTWLoggingReqd(RDSNo)
|
|||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service TestWaferRanAfterLoad(RDSNo)
|
Service TestWaferRanAfterLoad(RDSNo)
|
||||||
|
|
||||||
TestWaferRanAfterLoad = False$
|
TestWaferRanAfterLoad = False$
|
||||||
TestWaferKeys = Test_Run_Services('GetTestRunKeysByRDS', RDSNo)
|
TestWaferKeys = Test_Run_Services('GetTestRunKeysByRDS', RDSNo)
|
||||||
for each Key in TestWaferKeys using @VM
|
for each Key in TestWaferKeys using @VM
|
||||||
@ -891,8 +902,10 @@ Service TestWaferRanAfterLoad(RDSNo)
|
|||||||
Next Key
|
Next Key
|
||||||
|
|
||||||
Response = TestWaferRanAfterLoad
|
Response = TestWaferRanAfterLoad
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
// VerifyEPPMetrology
|
// VerifyEPPMetrology
|
||||||
//
|
//
|
||||||
@ -1027,11 +1040,6 @@ Service VerifyEPPMetrology(RDSNo)
|
|||||||
IF LayerList<I,COL$THICK_AVG_Z1> = '' AND LayerList<I,COL$RRHO_AVG_Z1> = '' AND LayerList<I,COL$MET_NO_Z1> NE '' THEN
|
IF LayerList<I,COL$THICK_AVG_Z1> = '' AND LayerList<I,COL$RRHO_AVG_Z1> = '' AND LayerList<I,COL$MET_NO_Z1> NE '' THEN
|
||||||
ErrorMsg = 'Zone 1 Metrology is Incomplete for RDS: ':RDSNo
|
ErrorMsg = 'Zone 1 Metrology is Incomplete for RDS: ':RDSNo
|
||||||
END
|
END
|
||||||
//Added check for missing res avg data - JRO
|
|
||||||
/*IF LayerList<I,COL$THICK_AVG_Z1> NE '' AND LayerList<I,COL$RRHO_AVG_Z1> = '' AND LayerList<I,COL$MET_NO_Z1> NE '' THEN
|
|
||||||
If Error_Services('NoError') then Error_Services('Add', 'Zone 1 Metrology is missing Resistivity data for RDS: ':RDSNo)
|
|
||||||
END
|
|
||||||
*/
|
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
@ -1048,20 +1056,13 @@ Service VerifyEPPMetrology(RDSNo)
|
|||||||
|
|
||||||
IF NOT(obj_RDS_Test('TestComplete',MetNo:@RM:MetRec)) THEN
|
IF NOT(obj_RDS_Test('TestComplete',MetNo:@RM:MetRec)) THEN
|
||||||
ErrorMsg = 'Zone 2 Metrology is Incomplete for RDS: ':RDSNo
|
ErrorMsg = 'Zone 2 Metrology is Incomplete for RDS: ':RDSNo
|
||||||
END ELSE
|
END ELSE
|
||||||
|
|
||||||
IF ( (obj_RDS_Test('OutOfSpec',MetNo:@RM:MetRec) = 1) and (Zone2Scrapped EQ False$) ) THEN
|
IF ( (obj_RDS_Test('OutOfSpec',MetNo:@RM:MetRec) = 1) and (Zone2Scrapped EQ False$) ) THEN
|
||||||
ErrorMsg = 'Zone 2 Metrology is Out of Spec for RDS: ':RDSNo
|
ErrorMsg = 'Zone 2 Metrology is Out of Spec for RDS: ':RDSNo
|
||||||
END ELSE
|
END ELSE
|
||||||
IF LayerList<I,COL$THICK_AVG_Z2> = '' AND LayerList<I,COL$RRHO_AVG_Z2> = '' AND LayerList<I,COL$MET_NO_Z2> NE '' THEN
|
IF LayerList<I,COL$THICK_AVG_Z2> = '' AND LayerList<I,COL$RRHO_AVG_Z2> = '' AND LayerList<I,COL$MET_NO_Z2> NE '' THEN
|
||||||
ErrorMsg = 'Zone 2 Metrology is Incomplete for RDS: ':RDSNo
|
ErrorMsg = 'Zone 2 Metrology is Incomplete for RDS: ':RDSNo
|
||||||
END
|
END
|
||||||
/*
|
|
||||||
//Added check for missing res avg data - JRO
|
|
||||||
IF LayerList<I,COL$THICK_AVG_Z2> NE '' AND LayerList<I,COL$RRHO_AVG_Z2> = '' AND LayerList<I,COL$MET_NO_Z2> NE '' THEN
|
|
||||||
If Error_Services('NoError') then Error_Services('Add', 'Zone 2 Metrology is missing Resistivity data for RDS: ':RDSNo)
|
|
||||||
END
|
|
||||||
*/
|
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
@ -1122,6 +1123,7 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service CopyRDSLayerParameters(RDSNo)
|
Service CopyRDSLayerParameters(RDSNo)
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'CopyRDSLayerParameters'
|
MetricName = 'CopyRDSLayerParameters'
|
||||||
|
|
||||||
@ -1178,6 +1180,7 @@ Service CopyRDSLayerParameters(RDSNo)
|
|||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -1208,6 +1211,7 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service ConvertRecordToJSON(KeyID, Record, itemURL)
|
Service ConvertRecordToJSON(KeyID, Record, itemURL)
|
||||||
|
|
||||||
jsonRecord = ''
|
jsonRecord = ''
|
||||||
If KeyID NE '' then
|
If KeyID NE '' then
|
||||||
|
|
||||||
@ -1385,8 +1389,7 @@ Service ConvertRecordToJSON(KeyID, Record, itemURL)
|
|||||||
end
|
end
|
||||||
|
|
||||||
If itemURL NE '' then
|
If itemURL NE '' then
|
||||||
// The itemURL was passed in so add HAL+JSON properties.
|
// The itemURL was passed in so add HAL+JSON properties.
|
||||||
|
|
||||||
// Create the _links property and then all link objects needed for this resource.
|
// Create the _links property and then all link objects needed for this resource.
|
||||||
If SRP_JSON(objLinks, 'New', 'Object') then
|
If SRP_JSON(objLinks, 'New', 'Object') then
|
||||||
// Create a self link.
|
// Create a self link.
|
||||||
@ -1398,8 +1401,7 @@ Service ConvertRecordToJSON(KeyID, Record, itemURL)
|
|||||||
end
|
end
|
||||||
SRP_JSON(objJSON, 'Set', '_links', objLinks)
|
SRP_JSON(objJSON, 'Set', '_links', objLinks)
|
||||||
SRP_JSON(objLinks, 'Release')
|
SRP_JSON(objLinks, 'Release')
|
||||||
end
|
end
|
||||||
|
|
||||||
// Create the _class property for this resource.
|
// Create the _class property for this resource.
|
||||||
SRP_JSON(objJSON, 'SetValue', '_class', 'resource')
|
SRP_JSON(objJSON, 'SetValue', '_class', 'resource')
|
||||||
end
|
end
|
||||||
@ -1412,7 +1414,6 @@ Service ConvertRecordToJSON(KeyID, Record, itemURL)
|
|||||||
end else
|
end else
|
||||||
Error_Services('Add', 'KeyID argument was missing in the ' : Service : ' service.')
|
Error_Services('Add', 'KeyID argument was missing in the ' : Service : ' service.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Response = jsonRecord
|
Response = jsonRecord
|
||||||
|
|
||||||
end service
|
end service
|
||||||
@ -1722,12 +1723,13 @@ Service UnsignLoadExtra2(RDSNo, LSLUserName)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service ApplyQA100PercentADE(RDSNo)
|
Service ApplyQA100PercentADE(RDSNo)
|
||||||
|
|
||||||
Result = False$
|
Result = False$
|
||||||
ErrorMsg = ''
|
ErrorMsg = ''
|
||||||
If RDSNo NE '' then
|
If RDSNo NE '' then
|
||||||
// Change the QA metrology requirements to all wafers
|
// Change the QA metrology requirements to all wafers
|
||||||
WoNo = Xlate('RDS', RDSNo, RDS_WO$, 'X')
|
WoNo = Xlate('RDS', RDSNo, RDS_WO$, 'X')
|
||||||
CassNo = Xlate('RDS', RDSNo, 'CASS_NO', 'X')
|
CassNo = Xlate('RDS', RDSNo, 'CASS_NO', 'X')
|
||||||
WoMatQaKey = WoNo : '*' : CassNo
|
WoMatQaKey = WoNo : '*' : CassNo
|
||||||
@ -1801,6 +1803,7 @@ Service ApplyQA100PercentADE(RDSNo)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service ApplyAbortMetrology(RdsKeys)
|
Service ApplyAbortMetrology(RdsKeys)
|
||||||
|
|
||||||
Result = False$
|
Result = False$
|
||||||
@ -1840,7 +1843,9 @@ Service ApplyAbortMetrology(RdsKeys)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service DetachRDSFromWO(RDSNo)
|
Service DetachRDSFromWO(RDSNo)
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If RowExists('RDS', RDSNo) then
|
If RowExists('RDS', RDSNo) then
|
||||||
RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo)
|
RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo)
|
||||||
@ -1860,6 +1865,127 @@ Service DetachRDSFromWO(RDSNo)
|
|||||||
If ErrorMessage NE '' then
|
If ErrorMessage NE '' then
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
Service PushSigProfileToWoMat(RDSNo)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
If (RDSNo NE '') then
|
||||||
|
If RowExists('RDS', RDSNo) then
|
||||||
|
Record = Database_Services('ReadDataRow', 'RDS', RDSNo)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
WONo = Record<RDS_WO$>
|
||||||
|
ReactType = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X')
|
||||||
|
EpiPro = (ReactType EQ 'EPP')
|
||||||
|
GaN = (ReactType EQ 'GAN')
|
||||||
|
NonEpiPro = ( (ReactType NE 'EPP') and (ReactType NE 'GAN') )
|
||||||
|
If NonEpiPro then
|
||||||
|
// Sync up VER, LOAD, UNLOAD, POST, and QA signatures with WO_MAT signature profile.
|
||||||
|
// The goal of signature services was to remove any dependency on the WO_MAT signature profile,
|
||||||
|
// however Fabtime relies on this data being replicated to the Scrape SQL DB.
|
||||||
|
WOMatKey = Xlate('RDS', RDSNo, 'WO_MAT_KEY', 'X')
|
||||||
|
If WOMatKey NE '' then
|
||||||
|
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
WOMatSigProf = obj_WO_Mat('CassSigProfile', WOMatKey)
|
||||||
|
WOMatSig = WOMatRec<WO_MAT_SIGNATURE$>
|
||||||
|
WOMatSigDTM = WOMatRec<WO_MAT_SIG_DTM$>
|
||||||
|
|
||||||
|
// Update WO_MAT signature profile to match for the "1VER" stage
|
||||||
|
Stage = '1VER'
|
||||||
|
Locate Stage in WOMatSigProf using @VM setting vPos then
|
||||||
|
WOMatSig<0, vPos> = Record<RDS_PRE_EPI_SIG$>
|
||||||
|
PreEpiDate = Record<RDS_PRE_EPI_SIG_DATE$>
|
||||||
|
If PreEpiDate NE '' then
|
||||||
|
PreEpiTime = Record<RDS_PRE_EPI_SIG_TIME$>
|
||||||
|
PreEpiSigDTM = PreEpiDate + (PreEpiTime/86400)
|
||||||
|
end else
|
||||||
|
PreEpiSigDTM = ''
|
||||||
|
end
|
||||||
|
WOMatSigDTM<0, vPos> = PreEpiSigDTM
|
||||||
|
end
|
||||||
|
|
||||||
|
// Update WO_MAT signature profile to match for "1LOAD" stage
|
||||||
|
Stage = '1LOAD'
|
||||||
|
Locate Stage in WOMatSigProf using @VM setting vPos then
|
||||||
|
WOMatSig<0, vPos> = Record<RDS_OPERATOR_IN$>
|
||||||
|
DateIn = Record<RDS_DATE_IN$>
|
||||||
|
If DateIn NE '' then
|
||||||
|
LoadTime = Record<RDS_TIME_IN$>
|
||||||
|
LoadSigDTM = DateIn + (LoadTime/86400)
|
||||||
|
end else
|
||||||
|
LoadSigDTM = ''
|
||||||
|
end
|
||||||
|
WOMatSigDTM<0, vPos> = LoadSigDTM
|
||||||
|
end
|
||||||
|
|
||||||
|
// Update WO_MAT signature profile to match for the "1UNLOAD" stage
|
||||||
|
Stage = '1UNLOAD'
|
||||||
|
Locate Stage in WOMatSigProf using @VM setting vPos then
|
||||||
|
WOMatSig<0, vPos> = Record<RDS_OPERATOR_OUT$>
|
||||||
|
DateOut = Record<RDS_DATE_OUT$>
|
||||||
|
If DateOut NE '' then
|
||||||
|
TimeOut = Record<RDS_TIME_OUT$>
|
||||||
|
TimeOutSigDTM = DateOut + (TimeOut/86400)
|
||||||
|
end else
|
||||||
|
TimeOutSigDTM = ''
|
||||||
|
end
|
||||||
|
WOMatSigDTM<0, vPos> = TimeOutSigDTM
|
||||||
|
end
|
||||||
|
|
||||||
|
// Update WO_MAT signature profile to match for the "1POST" stage
|
||||||
|
Stage = '1POST'
|
||||||
|
Locate Stage in WOMatSigProf using @VM setting vPos then
|
||||||
|
WOMatSig<0, vPos> = Record<RDS_POST_EPI_SIG$>
|
||||||
|
PostSigDate = Record<RDS_POST_EPI_SIG_DATE$>
|
||||||
|
If PostSigDate NE '' then
|
||||||
|
PostSigTime = Record<RDS_POST_EPI_SIG_TIME$>
|
||||||
|
PostSigDTM = PostSigDate + (PostSigTime/86400)
|
||||||
|
end else
|
||||||
|
PostSigDTM = ''
|
||||||
|
end
|
||||||
|
WOMatSigDTM<0, vPos> = PostSigDTM
|
||||||
|
end
|
||||||
|
|
||||||
|
// Update WO_MAT signature profile to match for the "1QA" stage
|
||||||
|
Stage = '1QA'
|
||||||
|
Locate Stage in WOMatSigProf using @VM setting vPos then
|
||||||
|
WOMatSig<0, vPos> = Record<RDS_SUP_VER_SIG$>
|
||||||
|
FQADate = Record<RDS_SUP_VER_SIG_DATE$>
|
||||||
|
If FQADate NE '' then
|
||||||
|
FQASigTime = Record<RDS_SUP_VER_SIG_TIME$>
|
||||||
|
FQASigDTM = FQADate + (FQASigTime/86400)
|
||||||
|
end else
|
||||||
|
FQASigDTM = ''
|
||||||
|
end
|
||||||
|
WOMatSigDTM<0, vPos> = FQASigDTM
|
||||||
|
end
|
||||||
|
|
||||||
|
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_PROFILE$, WOMatSigProf)
|
||||||
|
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSig)
|
||||||
|
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTM)
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null WO_MAT_KEY returned for RDS ':RDSNo:'.'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. RDS ':RDSNo:' does not exist.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null RDSNo passed into service.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -1874,12 +2000,3 @@ ClearCursors:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
232
LSL2/STPROC/TRANSACTION_SERVICES.txt
Normal file
232
LSL2/STPROC/TRANSACTION_SERVICES.txt
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
Compile function Transaction_Services(@Service, @Params)
|
||||||
|
/***********************************************************************************************************************
|
||||||
|
|
||||||
|
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||||
|
permission from Infineon Technologies.
|
||||||
|
|
||||||
|
Name : Transaction_Services
|
||||||
|
|
||||||
|
Description : Handler program for all module related services.
|
||||||
|
|
||||||
|
Notes : Service module to support environmental state issues. Environmental refers to the state of the
|
||||||
|
operating system, which includes version, client vs. server, and path to critical systems.
|
||||||
|
|
||||||
|
Parameters :
|
||||||
|
Service [in] -- Name of the service being requested
|
||||||
|
Param1-10 [in/out] -- Additional request parameter holders
|
||||||
|
Response [out] -- Response to be sent back to the requesting procedure
|
||||||
|
|
||||||
|
Metadata :
|
||||||
|
|
||||||
|
History : (Date, Initials, Notes)
|
||||||
|
06/24/25 djs Original programmer.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
$Insert SERVICE_SETUP
|
||||||
|
$Insert APP_INSERTS
|
||||||
|
$Insert TRANSACTION_QUEUE_EQUATES
|
||||||
|
|
||||||
|
EQU COMMA$ to ','
|
||||||
|
|
||||||
|
Declare function Datetime, RTI_CreateGuid, Error_Services, SRP_Encode, SRP_Decode, Database_Services
|
||||||
|
Declare function Environment_Services, Logging_Services
|
||||||
|
Declare subroutine Database_Services, Error_Services, Logging_Services
|
||||||
|
|
||||||
|
GoToService
|
||||||
|
|
||||||
|
Return Response or ""
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// SERVICES
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Service PostWriteFieldTransaction(Table, Key, FieldNo, FieldVal)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
Begin Case
|
||||||
|
Case (Table EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Table passed into service.'
|
||||||
|
Case (Key EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Key passed into service.'
|
||||||
|
Case (FieldNo EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Table passed into service.'
|
||||||
|
Case Not(Num(FieldNo))
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. FieldNo ':FieldNo:' is not a number.'
|
||||||
|
Case Otherwise$
|
||||||
|
TransKey = RTI_CreateGuid()
|
||||||
|
TransRec = ''
|
||||||
|
TransRec<TRANSACTION_QUEUE.TRANSACTION_DTM$> = Datetime()
|
||||||
|
TransRec<TRANSACTION_QUEUE.ACTION$> = 'WRITE_FIELD'
|
||||||
|
TransRec<TRANSACTION_QUEUE.TABLE$> = Table
|
||||||
|
TransRec<TRANSACTION_QUEUE.KEY$> = Key
|
||||||
|
TransRec<TRANSACTION_QUEUE.COLUMN$> = FieldNo
|
||||||
|
TransRec<TRANSACTION_QUEUE.VALUE$> = FieldVal
|
||||||
|
Database_Services('WriteDataRow', 'TRANSACTION_QUEUE', TransKey, TransRec)
|
||||||
|
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
||||||
|
End Case
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = True$
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
Response = False$
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
Service PostWriteRecordTransaction(Table, Key, Record)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
Begin Case
|
||||||
|
Case (Table EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Table passed into service.'
|
||||||
|
Case (Key EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Key passed into service.'
|
||||||
|
Case (Record EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Record passed into service.'
|
||||||
|
Case Otherwise$
|
||||||
|
TransKey = RTI_CreateGuid()
|
||||||
|
TransRec = ''
|
||||||
|
TransRec<TRANSACTION_QUEUE.TRANSACTION_DTM$> = Datetime()
|
||||||
|
TransRec<TRANSACTION_QUEUE.ACTION$> = 'WRITE_RECORD'
|
||||||
|
TransRec<TRANSACTION_QUEUE.TABLE$> = Table
|
||||||
|
TransRec<TRANSACTION_QUEUE.KEY$> = Key
|
||||||
|
TransRec<TRANSACTION_QUEUE.RECORD$> = SRP_Encode(Record, 'BASE64')
|
||||||
|
Database_Services('WriteDataRow', 'TRANSACTION_QUEUE', TransKey, TransRec)
|
||||||
|
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
||||||
|
End Case
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = True$
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
Response = False$
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
Service PostDeleteRecordTransaction(Table, Key)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
Begin Case
|
||||||
|
Case (Table EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Table passed into service.'
|
||||||
|
Case (Key EQ '')
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null Key passed into service.'
|
||||||
|
Case Otherwise$
|
||||||
|
TransKey = RTI_CreateGuid()
|
||||||
|
TransRec = ''
|
||||||
|
TransRec<TRANSACTION_QUEUE.TRANSACTION_DTM$> = Datetime()
|
||||||
|
TransRec<TRANSACTION_QUEUE.ACTION$> = 'DELETE_RECORD'
|
||||||
|
TransRec<TRANSACTION_QUEUE.TABLE$> = Table
|
||||||
|
TransRec<TRANSACTION_QUEUE.KEY$> = Key
|
||||||
|
Database_Services('WriteDataRow', 'TRANSACTION_QUEUE', TransKey, TransRec)
|
||||||
|
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
||||||
|
End Case
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = True$
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
Response = False$
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
Service ProcessTransactionQueue()
|
||||||
|
|
||||||
|
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||||
|
Lock hSysLists, ServiceKeyID then
|
||||||
|
|
||||||
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Transaction'
|
||||||
|
LogDate = Oconv(Date(), 'D4/')
|
||||||
|
LogTime = Oconv(Time(), 'MTS')
|
||||||
|
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Transaction Queue Log.csv'
|
||||||
|
Headers = 'Logging DTM':@FM:'Result':@FM:'Action':@FM:'Table':@FM:'Key':@FM:'Base64Record'
|
||||||
|
Headers := @FM:'Column':@FM:'Value'
|
||||||
|
objQueueLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||||
|
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||||
|
|
||||||
|
Select 'TRANSACTION_QUEUE' by 'TRANSACTION_DTM' setting Cursor then
|
||||||
|
EOF = False$
|
||||||
|
Loop
|
||||||
|
LogData = ''
|
||||||
|
DeleteTrans = False$
|
||||||
|
ErrorMsg = ''
|
||||||
|
ReadNext TransId using Cursor By At else EOF = True$
|
||||||
|
Until EOF
|
||||||
|
TransRec = Database_Services('ReadDataRow', 'TRANSACTION_QUEUE', TransId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Action = TransRec<TRANSACTION_QUEUE.ACTION$>
|
||||||
|
Table = TransRec<TRANSACTION_QUEUE.TABLE$>
|
||||||
|
Key = TransRec<TRANSACTION_QUEUE.KEY$>
|
||||||
|
HaveLock = Database_Services('GetKeyIDLock', Table, Key)
|
||||||
|
If HaveLock then
|
||||||
|
Begin Case
|
||||||
|
Case Action EQ 'WRITE_FIELD'
|
||||||
|
FieldNo = TransRec<TRANSACTION_QUEUE.COLUMN$>
|
||||||
|
FieldVal = TransRec<TRANSACTION_QUEUE.VALUE$>
|
||||||
|
LogData<7> = FieldNo
|
||||||
|
LogData<8> = FieldVal
|
||||||
|
Open Table to hTable then
|
||||||
|
WriteV FieldVal on hTable, Key, FieldNo then
|
||||||
|
DeleteTrans = True$
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Error calling WriteV. '
|
||||||
|
ErrorMsg := 'File error: ':@File_Error
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Error opening ':Table:'.'
|
||||||
|
end
|
||||||
|
Case Action EQ 'WRITE_RECORD'
|
||||||
|
Record = SRP_Decode(TransRec<TRANSACTION_QUEUE.RECORD$>, 'BASE64')
|
||||||
|
LogData<6> = Record
|
||||||
|
Database_Services('WriteDataRow', Table, Key, Record, True$, False$, False$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
DeleteTrans = True$
|
||||||
|
end else
|
||||||
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
Case Action EQ 'DELETE_RECORD'
|
||||||
|
Database_Services('DeleteDataRow', Table, Key, True$, False$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
DeleteTrans = True$
|
||||||
|
end else
|
||||||
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
Case Otherwise$
|
||||||
|
DeleteTrans = True$
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Invalid Action ':Action:'.'
|
||||||
|
End Case
|
||||||
|
Database_Services('ReleaseKeyIDLock', Table, Key)
|
||||||
|
If DeleteTrans then Database_Services('DeleteDataRow', 'TRANSACTION_QUEUE', TransId)
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Failed to get lock on ':Table:' ':Key:'.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||||
|
LogData<3> = Action
|
||||||
|
LogData<4> = Table
|
||||||
|
LogData<5> = Key
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
// Log success
|
||||||
|
LogData<2> = 'Successfully processed transaction ':TransId:'.'
|
||||||
|
end else
|
||||||
|
// Log failure
|
||||||
|
LogData<2> = 'Failed to process transaction ':TransId:'. Error message: ':ErrorMsg
|
||||||
|
end
|
||||||
|
Logging_Services('AppendLog', objQueueLog, LogData, @RM, @FM)
|
||||||
|
Repeat
|
||||||
|
end
|
||||||
|
Unlock hSysLists, ServiceKeyID else Null
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
Reference in New Issue
Block a user