Page 1 of 1

VLF-ONE handling avExecuteAsyncOperation failure

Posted: Wed Apr 25, 2018 1:43 am
by jyoung
When using avExecuteAyncOperation what is the best way to handle server failure?

For example

Code: Select all

mthroutine name(avExecuteAsyncOperation) options(*REDEFINE)
case of_field(#OperationID.UpperCase)
when (= GET)
#Get.Execute officenumber(#VLFOfficeLookup.OfficeNumber) formalname(#CLOFN) countrycode(#VLFCountryLookup.CountryCode) pagenumber(#wk_PageNumber) pagesize(#wk_PageSize) sortby(#wk_SortBy) sortdirection(#wk_SortDirection) resultlist(#ListItems) recordcount(#wk_Count) status(#wk_Status)
when (= DOWNLOAD)
#Csv.Execute countrycode(#VLFCountryLookup.CountryCode) officenumber(#VLFOfficeLookup.OfficeNumber) formalname(#CLOFN)
when (= EMAIL)
#Email.Execute officenumber(#VLFOfficeLookup.OfficeNumber) formalname(#CLOFN) countrycode(#VLFCountryLookup.CountryCode) email(#Parameter1) status(#wk_Status)
endcase
endroutine
The GET can take some time to complete and can fail.

Whats the best way to handle the failure? Do I just subscribe to the failed event? Does it get called even though it is executed without async?

Re: VLF-ONE handling avExecuteAsyncOperation failure

Posted: Wed Apr 25, 2018 2:06 am
by jyoung
After a bit of experimentation, it looks like the Completed and Failed events still get fired when Execute is used vs ExecuteAsync.

So it seems I can use the Failed event to trap the failure and handle accordingly.

Re: VLF-ONE handling avExecuteAsyncOperation failure

Posted: Wed Apr 25, 2018 8:04 am
by dannyoorburg
Hi Joe,

That's correct, they still fire.

Also there's the catch-all RequestFailed event on #SYS_WEB that fires for both Sync and Async.

Danny.