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:
@ -32,6 +32,7 @@ $insert SERVICE_SETUP
|
||||
$insert SERVICES_EQUATES
|
||||
$insert RLIST_EQUATES
|
||||
$insert SQL_REQUESTS_EQUATES
|
||||
$Insert PROC_QUEUE_EQUATES
|
||||
|
||||
Common /ServiceServices/ Unused1@, Unused2@, Unused3@, Unused4@, Unused5@, Unused6@, Unused7@, Unused8@, Unused9@, Unused10@
|
||||
|
||||
@ -154,20 +155,17 @@ end service
|
||||
|
||||
Service ProcessProcedureQueue()
|
||||
|
||||
hValidationRequests = Database_Services('GetTableHandle', 'PROC_QUEUE')
|
||||
If Error_Services('NoError') then
|
||||
Sentence = "SELECT PROC_QUEUE WITH COMP_DTM NE ''"
|
||||
Set_Status(0)
|
||||
RList(Sentence, TARGET_ACTIVELIST$, '', '', '')
|
||||
Open 'PROC_QUEUE' to hProcQueue then
|
||||
Select hProcQueue
|
||||
EOF = False$
|
||||
Loop
|
||||
ReadNext RequestKeyID else EOF = True$
|
||||
Until EOF
|
||||
Lock hValidationRequests, RequestKeyID then
|
||||
Lock hProcQueue, RequestKeyID then
|
||||
RequestRow = Database_Services('ReadDataRow', 'PROC_QUEUE', RequestKeyID)
|
||||
If RequestRow NE '' then
|
||||
Procedure = RequestRow<1>
|
||||
Params = RequestRow<2>
|
||||
Procedure = RequestRow<PROC_QUEUE.PROC_NAME$>
|
||||
Params = RequestRow<PROC_QUEUE.PARAMS$>
|
||||
If Procedure NE '' then
|
||||
Dim ProcParams(10)
|
||||
For each Param in Params using @VM setting pPos
|
||||
@ -190,13 +188,13 @@ Service ProcessProcedureQueue()
|
||||
end
|
||||
end
|
||||
If Error_Services('NoError') then
|
||||
RequestRow<3> = DateTime()
|
||||
Database_Services('DeleteDataRow', 'PROC_QUEUE', RequestKeyId, True$, False$)
|
||||
end else
|
||||
RequestRow<3> = DateTime()
|
||||
RequestRow<4> = Error_Services('GetMessage')
|
||||
RequestRow<PROC_QUEUE.LAST_ATTEMPT_DTM$> = DateTime()
|
||||
RequestRow<PROC_QUEUE.ERROR$> = Error_Services('GetMessage')
|
||||
Database_Services('WriteDataRow', 'PROC_QUEUE', RequestKeyID, RequestRow, True$, False$, True$)
|
||||
end
|
||||
Database_Services('WriteDataRow', 'PROC_QUEUE', RequestKeyID, RequestRow, True$, False$, True$)
|
||||
Unlock hValidationRequests, RequestKeyID else Null
|
||||
Unlock hProcQueue, RequestKeyID else Null
|
||||
end
|
||||
Repeat
|
||||
end
|
||||
@ -208,35 +206,13 @@ Service PostProcecure(ProcedureName, Params)
|
||||
|
||||
Response = ''
|
||||
If (ProcedureName NE '') then
|
||||
RequestKeyID = RTI_CreateGUID()
|
||||
RequestRow = ''
|
||||
RequestRow<SQL_REQUESTS.DB_PATH$> = ''
|
||||
RequestRow<SQL_REQUESTS.QUERY$> = ''
|
||||
Database_Services('WriteDataRow', 'SQL_REQUESTS', RequestKeyID, RequestRow, False$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
TimeExpired = False$
|
||||
Start = GetTickCount()
|
||||
Loop
|
||||
RequestRow = Database_Services('ReadDataRow', 'SQL_REQUESTS', RequestKeyID)
|
||||
ResponseDate = RequestRow<SQL_REQUESTS.RESPONSE_DATE$>
|
||||
If ResponseDate NE '' then
|
||||
Response = RequestRow<SQL_REQUESTS.RESPONSE$>
|
||||
Response = SRP_Decode(Response)
|
||||
end
|
||||
// Time will expire after 30 seconds.
|
||||
If GetTickCount() - Start GE 30000 then TimeExpired = True$
|
||||
Until (ResponseDate NE '') OR TimeExpired
|
||||
Sleepery(10)
|
||||
WinYield()
|
||||
Yield();Yield();Yield();Yield();Yield();Yield();Yield();Yield()
|
||||
Repeat
|
||||
If TimeExpired then
|
||||
Error_Services('Add', 'Timed out attempting to retrieve wafer image.')
|
||||
end
|
||||
Database_Services('DeleteDataRow', 'SQL_REQUESTS', RequestKeyID, True$)
|
||||
end
|
||||
RequestKeyID = RTI_CreateGUID()
|
||||
RequestRow = ''
|
||||
RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName
|
||||
RequestRow<PROC_QUEUE.PARAMS$> = Params
|
||||
Database_Services('WriteDataRow', 'PROC_QUEUE', RequestKeyID, RequestRow, True$, False$, False$)
|
||||
end else
|
||||
Error_Services('Add', 'Null parameter passed into service call. All parameters are required.')
|
||||
Error_Services('Add', 'Error in ':Service:' service. Null ProcedureName passed in.')
|
||||
end
|
||||
|
||||
return
|
||||
@ -247,3 +223,4 @@ return
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user