Add errors last

This commit is contained in:
Chase Tucker
2025-08-26 09:10:15 -07:00
parent 47405863d7
commit a196bffd41
7 changed files with 152 additions and 163 deletions

View File

@ -1127,6 +1127,7 @@ Service CopyRDSLayerParameters(RDSNo)
StartTick = GetTickCount()
MetricName = 'CopyRDSLayerParameters'
ErrMsg = ''
If (RDSNo NE '') then
RunOrderNo = Xlate('RDS', RDSNo, 'RUN_ORDER_NUM', 'X')
If (RunOrderNo GT 1) then
@ -1172,15 +1173,17 @@ Service CopyRDSLayerParameters(RDSNo)
Next CopyRDSLayerKey
end
end else
Error_Services('Add', 'No previous run to copy RDS layer parameters from in ':Service:' service.')
ErrMsg = 'No previous run to copy RDS layer parameters from in ':Service:' service.'
end
end else
Error_Services('Add', 'RDSNo not supplied in ':Service:' service.')
ErrMsg = 'RDSNo not supplied in ':Service:' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -2446,21 +2449,3 @@ ClearCursors:
Next counter
return

View File

@ -3768,7 +3768,7 @@ Service GetReactorAvailChamberCount(ReactNo)
StartTick = GetTickCount()
MetricName = 'GetReactorAvailChamberCount'
ErrMsg = 'Error in ReactorServices -> GetReactorAvailChamberCount: '
ErrMsg = ''
AvailableChamberCount = 0
If ReactNo NE '' then
If RowExists('REACTOR', ReactNo) then
@ -3778,16 +3778,19 @@ Service GetReactorAvailChamberCount(ReactNo)
AvailableChamberCount = ReactorCurrCapacity - ReactorCurrLoadCnt
end else
ErrMsg := 'Reactor ' : ReactNo : ' does not exist.'
Error_Services('Add', ErrMsg)
end
end else
ErrMsg := 'Reactor Number was null.'
Error_Services('Add', ErrMsg)
end
Response = AvailableChamberCount
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then
ErrMsg = 'Error in ReactorServices -> GetReactorAvailChamberCount: ':ErrMsg
Error_Services('Add', ErrMsg)
end
end service

View File

@ -263,6 +263,7 @@ API scan.ID.PATCH
SRP_Stopwatch('Start', 'IDPatchResponseTime')
// First confirm that this is a valid Scan ID.
jsonScan = Scan_Services('GetScansRow', ScanID, True$)
ErrMsg = ''
If Error_Services('NoError') then
// Confirm that all required data has been scanned before allowing the "accept" field to be updated.
ParseResponse = SRP_JSON(objResource, 'Parse', jsonScan)
@ -293,7 +294,7 @@ API scan.ID.PATCH
end
end else
ScanNotAcceptableReason = SRP_JSON(objResource, 'GetValue', 'scan.notAcceptableReason')
Error_Services('Add', ScanNotAcceptableReason)
ErrMsg = ScanNotAcceptableReason
end
SRP_JSON(objResource, 'Release')
end else
@ -324,6 +325,8 @@ API scan.ID.PATCH
end
LogData<6> = ResponseStatusCode
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end api
@ -438,3 +441,4 @@ return

View File

@ -214,19 +214,22 @@ Service GetScansRow(ScanID, ReturnJSON)
ScansRow = ''
ErrMsg = ''
If ScanID NE '' then
ScansRow = Database_Services('ReadDataRow', 'SCANS', ScanID)
If ReturnJSON EQ True$ then
ScansRow = Scan_Services('ConvertMVScanToJSON', ScanID, ScansRow)
end
end else
Error_Services('Add', 'ScanID argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID argument was missing in the ' : Service : ' service.'
end
Response = ScansRow
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -239,14 +242,17 @@ Service SetScansRow(ScanID, ScansRow)
StartTick = GetTickCount()
MetricName = 'SetScansRow'
ErrMsg = ''
If (ScanID NE '') AND (ScansRow NE '') then
Database_Services('WriteDataRow', 'SCANS', ScanID, ScansRow)
end else
Error_Services('Add', 'ScanID or ScansRow argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID or ScansRow argument was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -262,6 +268,7 @@ Service ProcessScanData(ScanID, ScanJSON)
StartTick = GetTickCount()
MetricName = 'ProcessScanData'
ErrMsg = ''
If ( (ScanID NE '') AND (ScanJSON NE '') ) then
hScanJSON = ''
ParseResponse = SRP_JSON(hScanJSON, 'PARSE', ScanJSON)
@ -300,7 +307,7 @@ Service ProcessScanData(ScanID, ScanJSON)
If RowExists('LOT', LotId) then
TWLots = ScansRow<SCANS.TW_LOT_ID$>
Locate LotId in TWLots using @VM setting twPos then
Error_Services('Add', LotID : ' has already been added as a test wafer lot being used.')
ErrMsg = LotID : ' has already been added as a test wafer lot being used.'
end else
ScansRow<SCANS.TW_LOT_CHANGED$> = True$
LotCurrentOperation = Lot_Services('GetLotCurrOperationName', LotId)
@ -316,14 +323,14 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.TW_LOT_QTY$, twPos> = 1
end
end else
Error_Services('Add', LotID : ' does not have enough wafers to be used.')
ErrMsg = LotID : ' does not have enough wafers to be used.'
end
end else
Error_Services('Add', LotID : ' is not at a valid operation for use.')
ErrMsg = LotID : ' is not at a valid operation for use.'
end
end
end else
Error_Services('Add', LotID : ' is not a valid test wafer lot ID.')
ErrMsg = LotID : ' is not a valid test wafer lot ID.'
end
Case Otherwise$
@ -350,9 +357,9 @@ Service ProcessScanData(ScanID, ScanJSON)
Case EmployeeAuthorized NE True$
// Regardless of the not authorized reason, the scan data will be considered invalid.
EmployeeNotAuthorizedReason = {EMPLOYEE_NOT_AUTHORIZED_REASON}
Error_Services('Add', EmployeeNotAuthorizedReason)
ErrMsg = EmployeeNotAuthorizedReason
Case EmployeeActive NE True$
Error_Services('Add', 'Inactive employee.')
ErrMsg = 'Inactive employee.'
Case Otherwise$
ScansRow<SCANS.EMPLOYEE_ID$> = {EMPLOYEE_ID}
@ -395,7 +402,7 @@ Service ProcessScanData(ScanID, ScanJSON)
If (EmployeeAuthorized NE True$) AND ({EMPLOYEE_ID} NE '') then
// Regardless of the not authorized reason, the scan data will be considered invalid.
EmployeeNotAuthorizedReason = {EMPLOYEE_NOT_AUTHORIZED_REASON}
Error_Services('Add', EmployeeNotAuthorizedReason)
ErrMsg = EmployeeNotAuthorizedReason
end else
* If LoadLock EQ '' then LoadLock = 'NA' ; // NA means Not Applicable.
ReactorID = ToolID[2, 999]
@ -415,10 +422,10 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.TOOL_ID$> = ToolID
ScansRow<SCANS.LOAD_LOCK$> = LoadLock
end else
Error_Services('Add', 'Invalid load lock value "':LoadLock:'".')
ErrMsg = 'Invalid load lock value "':LoadLock:'".'
end
end else
Error_Services('Add', 'A load lock side "L" or "R" is required for reactor ':ReactorID:'.')
ErrMsg = 'A load lock side "L" or "R" is required for reactor ':ReactorID:'.'
end
Case (LoadLockReq EQ False$)
If ScansRow<SCANS.LOCATION_ID$> NE '' then
@ -433,17 +440,17 @@ Service ProcessScanData(ScanID, ScanJSON)
end
Case ToolType _EQC 'Transfer'
Error_Services('Add', 'Tool type ':ToolType:' is not currently supported by the barcode application.')
ErrMsg = 'Tool type ':ToolType:' is not currently supported by the barcode application.'
// Code below may be implemented down the road.
// This is a transfer tool. Just update the scan resource.
* ScansRow<SCANS.LOCATION_ID$> = '' ; // Make sure the Location ID is cleared.
* ScansRow<SCANS.CASSETTE_IDS$> = ScansRow<SCANS.CASSETTE_IDS$, 1> ; // Make sure only the first Cassette ID is tracked.
* ScansRow<SCANS.TRANSFER_TOOL_ID$> = ToolID
Case Otherwise$
Error_Services('Add', 'Tool type ':ToolType:' is not currently supported by the barcode application.')
ErrMsg = 'Tool type ':ToolType:' is not currently supported by the barcode application.'
End Case
end else
Error_Services('Add', ToolID : ' is not a valid tool ID.')
ErrMsg = ToolID : ' is not a valid tool ID.'
end
Case ScanData[1, 2] EQ '1L'
@ -461,7 +468,7 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.TRANSFER_TOOL_ID$> = '' ; // Make sure the Transfer Tool ID is cleared.
ScansRow<SCANS.LOCATION_ID$> = LocationID
end else
Error_Services('Add', LocationID : ' is not a valid location ID.')
ErrMsg = LocationID : ' is not a valid location ID.'
end
Case ScanData[1, 2] EQ '1B'
@ -476,7 +483,7 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.BOAT_ID$> = BoatID
ScansRow<SCANS.PL_NUMBER$> = PLNo
end else
Error_Services('Add', ScanData : ' is not a valid boat ID.')
ErrMsg = ScanData : ' is not a valid boat ID.'
end
Case ScanData[1, 3] EQ 'PWD'
// Password/Signature scan. If the scan is not ready to be accepted or the password does
@ -491,14 +498,14 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.AUTHENTICATED$> = 1
end else
ScansRow<SCANS.AUTHENTICATED$> = 0
Error_Services('Add', 'Invalid password for user ':EmployeeID:'.')
ErrMsg = 'Invalid password for user ':EmployeeID:'.'
end
ScansRow<SCANS.EMPLOYEE_CHANGED$> = True$
end else
Error_Services('Add', 'An employee ID must be scanned before scanning a password.')
ErrMsg = 'An employee ID must be scanned before scanning a password.'
end
end else
Error_Services('Add', 'Invalid password scanned.')
ErrMsg = 'Invalid password scanned.'
end
Case ScanData[1, 8] EQ 'OVERRIDE'
@ -565,7 +572,7 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end else
Error_Services('Add', 'Selected Employee is not authorized to perform an override')
ErrMsg = 'Selected Employee is not authorized to perform an override'
end
end
Case ScanData[1, 2] EQ '5T'
@ -651,11 +658,11 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.CASSETTE_IDS$> = CassetteID
end
end else
Error_Services('Add', CassetteID : ' is not a valid Cassette ID.')
ErrMsg = CassetteID : ' is not a valid Cassette ID.'
end
End Case
If Error_Services('NoError') then
If ErrMsg EQ '' then
// Process Scan row data here to determine the type of scan (i.e. Location, Pre-Epi + Load, or Unload).
ScanType = ScansRow<SCANS.SCAN_TYPE$>
CassetteIDs = ScansRow<SCANS.CASSETTE_IDS$>
@ -682,7 +689,7 @@ Service ProcessScanData(ScanID, ScanJSON)
LastCassScanned = CassetteIDs<0, NumCass>
CurrStage = Xlate('RDS', LastCassScanned, 'CURR_STAGE', 'X')
If CurrStage EQ 'UNLOAD' then
Error_Services('Add', '(':LastCassScanned:') Cassette is currently loaded on a tool and is ineligble for a location scan.')
ErrMsg = '(':LastCassScanned:') Cassette is currently loaded on a tool and is ineligble for a location scan.'
end
Case ScanType EQ 'TOOL'
@ -756,7 +763,9 @@ Service ProcessScanData(ScanID, ScanJSON)
CassNo = Xlate('RDS', CassetteID, 'CASS_NO', 'X')
WOMatKey = WONo:'*':CassNo
WOMatLocs = Xlate('WO_MAT', WOMatKey, WO_MAT_INV_LOCATION$, 'X')
If Index(WOMatLocs,'PTI',1) else Error_Services('Add', 'Cassette ':CassetteID:' failed due to missing PTI.')
If Index(WOMatLocs,'PTI',1) else
ErrMsg = 'Cassette ':CassetteID:' failed due to missing PTI.'
end
end else
// EpiPro RDS
OutCassNos = Xlate('RDS', CassetteID, 'OUT_CASS_NO', 'X')
@ -766,11 +775,13 @@ Service ProcessScanData(ScanID, ScanJSON)
CassNo = OutCassNo
WOMatKey = WONo:'*':CassNo
WOMatLocs = Xlate('WO_MAT', WOMatKey, WO_MAT_INV_LOCATION$, 'X')
If Index(WOMatLocs,'PTI',1) else Error_Services('Add', 'Cassette ':CassetteID:' failed due to missing PTI.')
If Index(WOMatLocs,'PTI',1) else
ErrMsg = 'Cassette ':CassetteID:' failed due to missing PTI.'
end
Next OutCassNo
end
If Error_Services('NoError') then
If ErrMsg EQ '' then
If CurrStatus NE 'HOLD' then
If (EmployeeID NE '') then
* SupplInstAckReq = Xlate('RDS', RDSNo, 'SUPPL_ACK_REQ' , 'X')
@ -1033,17 +1044,17 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end else
ScansRow<SCANS.SUPPLIER_LOT$> = ''
Error_Services('Add', '(':CassetteID:') Supplier lot mismatch.')
ErrMsg = '(':CassetteID:') Supplier lot mismatch.'
end
end else
Scan_Services('AddNotAcceptableReason', 'Supplier lot scan required in order to complete a tool scan.')
end
end else
Error_Services('Add', '(':CassetteID:') The first run must be completed using the OpenInsight user interface.')
ErrMsg = '(':CassetteID:') The first run must be completed using the OpenInsight user interface.'
end
end else
Error_Services('Add', '(':CassetteID:') A pre-clean is required for this RDS. The OpenInsight user interface must be used to proceed.')
ErrMsg = '(':CassetteID:') A pre-clean is required for this RDS. The OpenInsight user interface must be used to proceed.'
end
Case CurrStage _EQC 'LOAD'
Action = 'LOAD'
@ -1103,7 +1114,7 @@ Service ProcessScanData(ScanID, ScanJSON)
Scan_Services('AddNotAcceptableReason', ErrorMessage)
end
end else
Error_Services('Add', 'Scanned tool ':ScanTool:' does not match the scheduled tool ':SchedTool:'. (':RDSNo:')')
ErrMsg = 'Scanned tool ':ScanTool:' does not match the scheduled tool ':SchedTool:'. (':RDSNo:')'
end
end else
Scan_Services('AddNotAcceptableReason', 'Test wafers are required to be logged with this run.')
@ -1111,7 +1122,7 @@ Service ProcessScanData(ScanID, ScanJSON)
end else
ScansRow<SCANS.SUPPLIER_LOT$> = ''
Error_Services('Add', '(':CassetteID:') Supplier lot mismatch.')
ErrMsg = '(':CassetteID:') Supplier lot mismatch.'
end
end else
Scan_Services('AddNotAcceptableReason', 'Supplier lot scan required in order to complete a tool scan.')
@ -1195,12 +1206,10 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end
end else
ErrorMessage = 'WO_MAT record was null.'
Error_Services('Add', ErrorMessage)
ErrMsg = 'WO_MAT record was null.'
end
end else
ErrorMessage = 'Failure to read cassette record. ' : Error_Services('GetMessage')
Error_Services('Add', ErrorMessage)
ErrMsg = 'Failure to read cassette record. ' : Error_Services('GetMessage')
end
end
end
@ -1218,24 +1227,23 @@ Service ProcessScanData(ScanID, ScanJSON)
end
Case CurrStage _EQC 'COMP'
Action = 'COMP'
Error_Services('Add', '(':CassetteID:") Cassette has already been FQA'd.")
ErrMsg = '(':CassetteID:") Cassette has already been FQA'd."
Case Otherwise$
Action = CurrStage
Error_Services('Set', '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.')
ErrMsg = '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.'
End Case
end else
Scan_Services('AddNotAcceptableReason', 'EmployeeID required to complete a tool scan.')
end
end else
Error_Services('Add', '(':CassetteID:') Process Error: cassette is on Hold and may not be signed off.')
ErrMsg = '(':CassetteID:') Process Error: cassette is on Hold and may not be signed off.'
end
end
end else
Error_Services('Add', '(':CassetteID:') WMI/WMO cassette are not currently supported for tool scans. The OpenInsight user interface must be used in order to proceed.')
ErrMsg = '(':CassetteID:') WMI/WMO cassette are not currently supported for tool scans. The OpenInsight user interface must be used in order to proceed.'
end
end else
// Currently we are only supporting loading one cassette onto a tool at a time.
Error_Services('Add', '(':CassetteID:') Only one cassette can be loaded onto a tool at a time.')
ErrMsg = '(':CassetteID:') Only one cassette can be loaded onto a tool at a time.'
end
end
@ -1296,7 +1304,7 @@ Service ProcessScanData(ScanID, ScanJSON)
End Case
end
// If the the scan data is valid, update the scan log before returning to the calling process.
If Error_Services('NoError') then
If ErrMsg EQ '' then
If Scan_Services('NoNotAcceptableReason') then
ScansRow<SCANS.ACCEPTABLE$> = True$
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = ''
@ -1306,7 +1314,7 @@ Service ProcessScanData(ScanID, ScanJSON)
end
end else
ScansRow<SCANS.ACCEPTABLE$> = False$
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = Error_Services('GetMessage')
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = ErrMsg
end
If ScanData NE '' then
ScansRow<SCANS.SCANNED_DATES$, -1> = Date()
@ -1314,25 +1322,21 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.SCANNED_DATA$, -1> = ScanData
end
ScansRow<SCANS.ACTION$> = Action
// Save error message if present as Database_Services will clear any errors.
ErrorMessage = ''
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
Database_Services('WriteDataRow', 'SCANS', ScanID, ScansRow, True$, False$, True$)
// Restore pre-existing error message if present.
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
end
end else
Error_Services('Add', 'Unable to parse the JSON scan data in the ':Service:' service.')
ErrMsg = 'Unable to parse the JSON scan data in the ':Service:' service.'
end
SRP_JSON(hScanJSON, 'Release')
end else
Error_Services('Add', 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -1344,6 +1348,7 @@ Service AcceptScan(ScanID, ScanJSON)
StartTick = GetTickCount()
MetricName = 'AcceptScan'
ErrMsg = ''
If ( (ScanID NE '') and (ScanJSON NE '') ) then
hBody = ''
ParseResponse = SRP_JSON(hBody, 'PARSE', ScanJSON)
@ -1376,7 +1381,7 @@ Service AcceptScan(ScanID, ScanJSON)
If Error_Services('NoError') AND SendStatus EQ 'Success' then
Result = 'Tencor Data Sent Successfully'
end else
Error_Services('Add', SendStatus)
ErrMsg = SendStatus
end
Case ScanType _EQC 'LOCATION'
@ -1481,8 +1486,7 @@ Service AcceptScan(ScanID, ScanJSON)
end
IF Get_Status(errCode) THEN
ErrorMsg = 'Error calling obj_WO_Mat_Log("Create"). Error code: ':errCode
Error_Services('Add', ErrorMsg)
ErrMsg = 'Error calling obj_WO_Mat_Log("Create"). Error code: ':errCode
END else
NumCass = DCount(CassetteIDs, @VM)
If NumCass EQ 1 then
@ -1545,8 +1549,7 @@ Service AcceptScan(ScanID, ScanJSON)
If Error_Services('NoError') then
Continue = True$
end else
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
Continue = False$
end
If Continue then
@ -1590,8 +1593,7 @@ Service AcceptScan(ScanID, ScanJSON)
If Error_Services('NoError') then
Continue = True$
end else
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
Continue = False$
end
If Continue then
@ -1627,8 +1629,7 @@ Service AcceptScan(ScanID, ScanJSON)
PSNo = Xlate('RDS', RDSNo, RDS_PROD_SPEC_ID$, True$, 'X')
NewTestRunId = Test_Run_Services('CreateTestRunRecord', TestRunType, 'R', Reactor, PSNo, RDSNo,Username , TestWaferLots, TestWaferLotQtys)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
Continue = False$
end
end
@ -1645,10 +1646,10 @@ Service AcceptScan(ScanID, ScanJSON)
end
Case CurrStage _EQC 'COMP'
Action = 'COMP'
Error_Services('Set', '(':CassetteID:") Cassette has already been FQA'd.")
ErrMsg = '(':CassetteID:") Cassette has already been FQA'd."
Case Otherwise$
Action = CurrStage
Error_Services('Set', '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.')
ErrMsg = '(':CassetteID:') The ':CurrStage:' is not currently supported by the barcode application.'
End Case
Case CassetteID EQ '' AND TestWaferLots NE ''
//Tool scan with ONLY test wafers being logged.
@ -1661,12 +1662,10 @@ Service AcceptScan(ScanID, ScanJSON)
If NewTestRunId NE '' then
Result = 'Test run logged successfully'
end else
ErrorMessage = 'Error while logging creating test run.'
Error_Services('Set', ErrorMessage)
ErrMsg = 'Error while logging creating test run.'
end
end else
ErrorMessage = Error_Services('GetMessage')
Error_Services('Set', ErrorMessage)
ErrMsg = Error_Services('GetMessage')
end
Case Otherwise$
//null
@ -1674,34 +1673,30 @@ Service AcceptScan(ScanID, ScanJSON)
End Case
end
If Error_Services('NoError') then
If ErrMsg EQ '' then
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = 'This scan has already been accepted.'
end else
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = Error_Services('GetMessage')
ScansRow<SCANS.NOT_ACCEPTABLE_REASON$> = ErrMsg
end
ScansRow<SCANS.ACCEPTABLE$> = False$
If Assigned(Result) then ScansRow<SCANS.RESULT$> = Result
// Save error message if present as Database_Services will clear any errors.
ErrorMessage = ''
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
Scan_Services('SetScansRow', ScanID, ScansRow)
// Restore pre-existing error message if present.
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
end else
Error_Services('Add', 'The accepted.status field is missing from the JSON object in the ':Service:' service.')
ErrMsg = 'The accepted.status field is missing from the JSON object in the ':Service:' service.'
end
SRP_JSON(hBody, 'Release')
end else
Error_Services('Add', 'Unable to parse the JSON scan resource in the ':Service:' service.')
ErrMsg = 'Unable to parse the JSON scan resource in the ':Service:' service.'
end
end else
Error_Services('Add', 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID or ScanJSON argument was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
//----------------------------------------------------------------------------------------------------------------------
@ -1719,6 +1714,7 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
mvScanChanged = False$
ErrMsg = ''
If ScanID NE '' then
If mvScan EQ '' then mvScan = Database_Services('ReadDataRow', 'SCANS', ScanID)
@ -2172,17 +2168,19 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
Database_Services('WriteDataRow', 'SCANS', {SCAN_ID}, mvScan, True$, False$, False$)
end
end else
Error_Services('Add', 'Unable to create JSON representation in the ' : Service : ' service.')
ErrMsg = 'Unable to create JSON representation in the ' : Service : ' service.'
end
end
end else
Error_Services('Add', 'ScanID argument was missing in the ' : Service : ' service.')
ErrMsg = 'ScanID argument was missing in the ' : Service : ' service.'
end
Response = jsonScan
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
//----------------------------------------------------------------------------------------------------------------------
@ -2421,3 +2419,5 @@ return

View File

@ -805,9 +805,9 @@ end service
Service GetCurrentEvent(ReactNo)
StartTick = GetTickCount()
MetricName = 'GetCurrentEvent'
ErrorMsg = ''
SchedDetKey = ''
ErrorMsg = ''
If ReactNo NE '' then
CurrDTM = Datetime()
Query = 'SELECT SCHED_DET_NG WITH REACT_NO EQ "':ReactNo:'" AND WITH EVENT_COMP NE 1 BY START_DTM'
@ -827,17 +827,14 @@ Service GetCurrentEvent(ReactNo)
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service CurrentEventIsBlock(ReactNo)
StartTick = GetTickCount()
MetricName = 'CurrentEventIsBlock'
ErrorMsg = ''
ErrorMsg = ''
If ReactNo NE '' then
CurrentSchedDetKey = Schedule_Services('GetCurrentEvent', ReactNo)
@ -861,18 +858,15 @@ Service CurrentEventIsBlock(ReactNo)
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service GetNextEvent(ReactNo)
StartTick = GetTickCount()
MetricName = 'GetNextEvent'
ErrorMsg = ''
SchedDetKey = ''
ErrorMsg = ''
If ReactNo NE '' then
CurrDTM = Datetime()
Query = 'SELECT SCHED_DET_NG WITH REACT_NO EQ "':ReactNo:'" AND WITH EVENT_COMP NE 1 BY START_DTM'
@ -902,10 +896,7 @@ Service GetNextEvent(ReactNo)
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service GetEngagedEvent(ReactNo)
@ -957,9 +948,9 @@ end service
Service NextEventIsSamePsn(ReactNo)
StartTick = GetTickCount()
MetricName = 'NextEventIsSamePsn'
ErrorMsg = ''
Response = False$
ErrorMsg = ''
If ReactNo NE '' then
CurrentSchedDetKey = Schedule_Services('GetCurrentEvent', ReactNo)
@ -1005,17 +996,14 @@ Service NextEventIsSamePsn(ReactNo)
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service NextEventIsBlock(ReactNo)
StartTick = GetTickCount()
MetricName = 'NextEventIsBlock'
ErrorMsg = ''
ErrorMsg = ''
If ReactNo NE '' then
NextSchedDetKey = Schedule_Services('GetNextEvent', ReactNo)
@ -1039,10 +1027,7 @@ Service NextEventIsBlock(ReactNo)
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
//----------------------------------------------------------------------------------------------------------------------

View File

@ -456,6 +456,7 @@ Service AcknowledgeSupplement(SupplID, EntryUser)
StartTick = GetTickCount()
MetricName = 'AcknowledgeSupplement'
ErrMsg = ''
If ( (SupplID NE '') and (EntryUser NE '') ) then
OldRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '')
If OldRec NE '' then
@ -469,19 +470,21 @@ Service AcknowledgeSupplement(SupplID, EntryUser)
Supplement_Services('LogSupplementChange', NewRec, 'Acknowledged', EntryUser)
end else
Response = FALSE$
Error_Services('Add', 'Error editing Supplement record.')
ErrMsg = 'Error editing Supplement record.'
end
end else
Response = FALSE$
Error_Services('Add', 'Record does not exist.')
ErrMsg = 'Record does not exist.'
end
end else
Response = FALSE$
Error_Services('Add', 'SupplID or EntryUser was missing in the ' : Service : ' service.')
ErrMsg = 'SupplID or EntryUser was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -501,6 +504,7 @@ Service UnacknowledgedSupplementCheck(LotType=LOTTYPES, LotID, Stage=STAGES)
UnackList = ''
Response = False$
ErrMsg = ''
If ( (LotType NE '') and (LotID NE '') and (Stage NE '') ) then
KeyList = ''
Query = ''
@ -518,23 +522,25 @@ Service UnacknowledgedSupplementCheck(LotType=LOTTYPES, LotID, Stage=STAGES)
If AckField NE True$ then UnackList<-1> = Key
Next Key
end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS table.')
ErrMsg = 'Error in ':Service:' service. Error opening SUPPLEMENTS table.'
end
end
end else
Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
ErrMsg = 'Error in ':Service:' service. Error calling Btree.Extract'
end
end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
ErrMsg = 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.'
end
end else
Error_Services('Add', 'LotType, LotID, or Stage was missing in the ' : Service : ' service.')
ErrMsg = 'LotType, LotID, or Stage was missing in the ' : Service : ' service.'
end
If UnackList NE '' then Response = UnackList
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -552,6 +558,7 @@ Service LogSupplementChange(SupplementRec, EditEvent, EntryUser)
StartTick = GetTickCount()
MetricName = 'LogSupplementChange'
ErrMsg = ''
If ( (SupplementRec NE '') and (EditEvent NE '') and (EntryUser NE '') ) then
SupplementText = SupplementRec<SUPPLEMENTS_SUPPL_TEXT$>
LotType = SupplementRec<SUPPLEMENTS_LOT_TYPE$>
@ -565,11 +572,13 @@ Service LogSupplementChange(SupplementRec, EditEvent, EntryUser)
End Case
end else
Error_Services('Add', 'LotType, LotID, or Stage was missing in the ' : Service : ' service.')
ErrMsg = 'LotType, LotID, or Stage was missing in the ' : Service : ' service.'
end
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then Error_Services('Add', ErrMsg)
end service
@ -670,3 +679,4 @@ Service SendNotifications(RDSList, EditEvent, Instructions, EntryUser)
end service

View File

@ -447,37 +447,43 @@ Service CassetteIsLastInWo(WoMatKey)
IsLastInWo = False$
ErrMsg = ''
If Unassigned(WoMatKey) or WoMatKey EQ '' or RowExists('WO_MAT', WoMatKey) NE True$ then
Error_Services('Add', 'invalid WO_MAT key')
ErrMsg = 'invalid WO_MAT key'
end
WO = Field(WoMatKey, '*', 1)
If WO EQ '' then
Error_Services('Add', 'WO# not found in WO_MAT record')
ErrMsg = 'WO# not found in WO_MAT record'
end
If Error_Services('NoError') and Num(WO) EQ False$ then
Error_Services('Add', 'WO# is not numeric')
If ErrMsg EQ '' and Num(WO) EQ False$ then
ErrMsg = 'WO# is not numeric'
end
CassNo = Field(WoMatKey, '*', 2)
If Error_Services('NoError') and CassNo EQ '' then
Error_Services('Add', 'Cassette# not found in WO_MAT record')
If ErrMsg EQ '' and CassNo EQ '' then
ErrMsg = 'Cassette# not found in WO_MAT record'
end
If Error_Services('NoError') and Num(CassNo) EQ False$ then
Error_Services('Add', 'Cassette# is not numeric')
If ErrMsg EQ '' and Num(CassNo) EQ False$ then
ErrMsg = 'Cassette# is not numeric'
end
If Error_Services('NoError') then
If ErrMsg EQ '' then
WoMatKeys = Xlate('WO_LOG', WO, WO_LOG_WO_MAT_KEY$, 'X')
If Error_Services('NoError') and WoMatKeys NE '' then
If WoMatKeys NE '' then
TotalCassettes = DCount(WoMatKeys, @VM)
IsLastInWo = TotalCassettes EQ CassNo
end else
ErrMsg = 'WO_MAT keys not found in WO_LOG for WO ':WO
end
end
If Error_Services('HasError') then
ErrMsg = Error_Services('GetMessage')
Response = IsLastInWo
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WOMatKey
@ -489,11 +495,6 @@ Service CassetteIsLastInWo(WoMatKey)
Error_Services('Add', ErrMsg)
end
Response = IsLastInWo
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
end service
@ -697,3 +698,4 @@ Service VerifyWOLogWOMatKeyColumn(WOMatKey)
end service