Added critical flag to PostProcedure service. Refactored other work order quantity calls to use PostProcedure.
This commit is contained in:
committed by
Stieber Daniel (CSC FI SPS MESLEO)
parent
5c69abbbde
commit
e5bfa43b09
@ -39,7 +39,7 @@ Common /ServiceServices/ Unused1@, Unused2@, Unused3@, Unused4@, Unused5@, Unuse
|
||||
Declare function Service_Services, Memory_Services, SRP_List, SRP_FastArray, SRP_Array, Database_Services, Datetime
|
||||
Declare Function GetTickCount, SRP_Decode, RTI_CREATEGUID
|
||||
Declare subroutine Service_Services, Memory_Services, SRP_List, SRP_FastArray, RList, Set_Status, Database_Services
|
||||
Declare Subroutine Yield, WinYield, Sleepery
|
||||
Declare Subroutine Yield, WinYield, Sleepery, Btree.Extract
|
||||
|
||||
GoToService else
|
||||
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
||||
@ -212,16 +212,41 @@ Service ProcessProcedureQueue()
|
||||
end service
|
||||
|
||||
|
||||
Service PostProcedure(ProcedureName, Params)
|
||||
Service PostProcedure(ProcedureName, Params, Critical=BOOLEAN)
|
||||
|
||||
Response = ''
|
||||
If Critical EQ '' then Critical = True$
|
||||
PostToQueue = True$
|
||||
If (ProcedureName NE '') then
|
||||
RequestKeyID = RTI_CreateGUID()
|
||||
RequestRow = ''
|
||||
RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName
|
||||
RequestRow<PROC_QUEUE.PARAMS$> = Params
|
||||
RequestRow<PROC_QUEUE.ENTRY_DTM$> = Datetime()
|
||||
Database_Services('WriteDataRow', 'PROC_QUEUE', RequestKeyID, RequestRow, True$, False$, False$)
|
||||
If (Params NE '') then
|
||||
If Not(Critical) then
|
||||
// Check if there is already a matching request in the queue before posting another one.
|
||||
Query = 'PROC_NAME':@VM:ProcedureName:@FM
|
||||
Query := 'PARAMS':@VM:Params:@FM
|
||||
Open 'DICT.PROC_QUEUE' to hDict then
|
||||
Keys = ''
|
||||
Option = 'E'
|
||||
Flag = ''
|
||||
Btree.Extract(Query, 'PROC_QUEUE', hDict, Keys, Option, Flag)
|
||||
If Flag EQ 0 then
|
||||
If Keys NE '' then PostToQueue = False$
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract.')
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Error opening DICT.PROC_QUEUE.')
|
||||
end
|
||||
end
|
||||
If PostToQueue then
|
||||
RequestKeyID = RTI_CreateGUID()
|
||||
RequestRow = ''
|
||||
RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName
|
||||
RequestRow<PROC_QUEUE.PARAMS$> = Params
|
||||
RequestRow<PROC_QUEUE.ENTRY_DTM$> = Datetime()
|
||||
Database_Services('WriteDataRow', 'PROC_QUEUE', RequestKeyID, RequestRow, True$, False$, False$)
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Null Params passed in.')
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Null ProcedureName passed in.')
|
||||
end
|
||||
@ -233,4 +258,3 @@ return
|
||||
/// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user