VLF-ONE handling avExecuteAsyncOperation failure
Posted: Wed Apr 25, 2018 1:43 am
When using avExecuteAyncOperation what is the best way to handle server failure?
For example
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?
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
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?