added check to verify PROC_NAME exists before invoking
This commit is contained in:
committed by
Stieber Daniel (CSC FI SPS MESLEO)
parent
cd64511871
commit
804b590773
@ -212,9 +212,9 @@ end service
|
|||||||
Service ProcessRequest(RequestKeyID)
|
Service ProcessRequest(RequestKeyID)
|
||||||
|
|
||||||
If RequestKeyID NE '' then
|
If RequestKeyID NE '' then
|
||||||
DeleteRequest = True$
|
|
||||||
Server = Environment_Services('GetServer')
|
Server = Environment_Services('GetServer')
|
||||||
Done = True$
|
InvalidRequest = False$
|
||||||
|
DeleteRequest = True$
|
||||||
If RowExists('PROC_QUEUE2', RequestKeyID) then
|
If RowExists('PROC_QUEUE2', RequestKeyID) then
|
||||||
RequestRow = Database_Services('ReadDataRow', 'PROC_QUEUE2', RequestKeyID)
|
RequestRow = Database_Services('ReadDataRow', 'PROC_QUEUE2', RequestKeyID)
|
||||||
If RequestRow NE '' then
|
If RequestRow NE '' then
|
||||||
@ -222,12 +222,15 @@ Service ProcessRequest(RequestKeyID)
|
|||||||
Procedure = UCase(Procedure)
|
Procedure = UCase(Procedure)
|
||||||
Params = RequestRow<PROC_QUEUE.PARAMS$>
|
Params = RequestRow<PROC_QUEUE.PARAMS$>
|
||||||
If Procedure NE '' then
|
If Procedure NE '' then
|
||||||
Dim ProcParams(12)
|
LSL2Key = '$':Procedure:'*LSL2'
|
||||||
|
FrameworksKey = '$':Procedure:'*FRAMEWORKS'
|
||||||
|
SysprogKey = '$':Procedure
|
||||||
|
If RowExists('SYSOBJ', LSL2Key) or RowExists('SYSOBJ', FrameworksKey) or RowExists('SYSOBJ', SysprogKey) then
|
||||||
|
Dim ProcParams(11)
|
||||||
For each Param in Params using @VM setting pPos
|
For each Param in Params using @VM setting pPos
|
||||||
ProcParams(pPos) = Param
|
ProcParams(pPos) = Param
|
||||||
Next Param
|
Next Param
|
||||||
NumArguments = DCount(Params, @VM)
|
NumArguments = DCount(Params, @VM)
|
||||||
|
|
||||||
Begin Case
|
Begin Case
|
||||||
Case NumArguments EQ 0 ; Call @Procedure()
|
Case NumArguments EQ 0 ; Call @Procedure()
|
||||||
Case NumArguments EQ 1 ; Call @Procedure(ProcParams(1))
|
Case NumArguments EQ 1 ; Call @Procedure(ProcParams(1))
|
||||||
@ -244,6 +247,13 @@ Service ProcessRequest(RequestKeyID)
|
|||||||
Case Otherwise$
|
Case Otherwise$
|
||||||
Error_Services('Add', 'Error in ':Service:' service. More than 11 arguments are not currently supported.')
|
Error_Services('Add', 'Error in ':Service:' service. More than 11 arguments are not currently supported.')
|
||||||
End Case
|
End Case
|
||||||
|
end else
|
||||||
|
InvalidRequest = True$
|
||||||
|
Error_Services('Add', 'Error in ':Service:' service. PROC_NAME ':Quote(Procedure):' does not exist.')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
InvalidRequest = True$
|
||||||
|
Error_Services('Add', 'Error in ':Service:' service. Null PROC_NAME posted to queue.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Swap @VM with ',' in Params
|
Swap @VM with ',' in Params
|
||||||
@ -253,10 +263,10 @@ Service ProcessRequest(RequestKeyID)
|
|||||||
LogData<4> = Procedure
|
LogData<4> = Procedure
|
||||||
LogData<5> = Params
|
LogData<5> = Params
|
||||||
ErrCode = ''
|
ErrCode = ''
|
||||||
If ( Get_Status(ErrCode) or Error_Services('HasError') ) then
|
If ( Get_Status(ErrCode) or Error_Services('HasError') or InvalidRequest) then
|
||||||
NumAttempts = RequestRow<PROC_QUEUE.NUM_ATTEMPTS$> + 1
|
NumAttempts = RequestRow<PROC_QUEUE.NUM_ATTEMPTS$> + 1
|
||||||
ErrorMessage = Error_Services('GetMessage')
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
If NumAttempts LT 3 then
|
If ( (NumAttempts LT 3) and Not(InvalidRequest) ) then
|
||||||
DeleteRequest = False$
|
DeleteRequest = False$
|
||||||
RequestRow<PROC_QUEUE.NUM_ATTEMPTS$> = NumAttempts
|
RequestRow<PROC_QUEUE.NUM_ATTEMPTS$> = NumAttempts
|
||||||
RequestRow<PROC_QUEUE.LAST_ATTEMPT_DTM$> = Datetime()
|
RequestRow<PROC_QUEUE.LAST_ATTEMPT_DTM$> = Datetime()
|
||||||
|
|||||||
Reference in New Issue
Block a user