[Stackoverflow] [Progress OpenEdge ABL] Why async task working and not working sometimes in progress?

Status
Not open for further replies.
B

Bharat

Guest
I have written a query for using async call also added completion progress which gives how many percentage finished in the back end before give call back but this asyn call working and not working sometimes. Let me share what i tried

DEFINE INPUT PARAMETER dProcessObj AS DECIMAL NO-UNDO.

DEFINE VARIABLE lError AS LOGICAL INIT FALSE.
DEFINE VARIABLE cError AS CHARACTER INIT ''.
DEFINE VARIABLE hProcess AS HANDLE NO-UNDO.
DEFINE VARIABLE hAppServer AS HANDLE NO-UNDO.
DEFINE VARIABLE hAsynCall AS HANDLE NO-UNDO.
DEFINE VARIABLE iTotal AS INTEGER NO-UNDO INIT 0.
DEFINE VARIABLE hCall AS HANDLE NO-UNDO.
DEFINE VARIABLE I AS INTEGER NO-UNDO.

IF VALID-HANDLE(gshAstraAppserver) = FALSE THEN DO:
MESSAGE "No server connected.." VIEW-AS ALERT-BOX.
RETURN.
END.
PROCESS EVENTS.
RUN VALUE(CallProgram) ON SERVER gshAstraAppserver ASYNCHRONOUS
SET hAsynCall (INPUT dProcessObj,
OUTPUT opcReturnValue) NO-ERROR.
IF ERROR-STATUS:ERROR OR hAsynCall:STOP OR hAsynCall:ERROR THEN DO:
MESSAGE ERROR-STATUS:GET-MESSAGE(1).
END.

DO WHILE NOT hAsynCall :COMPLETE ON ERROR UNDO, RETURN:
PROCESS EVENTS.
IF NOT hAsynCall :COMPLETE THEN DO:
RUN GetCompletionRec (INPUT dProcessObj,INPUT iTotal) NO-ERROR.
END.
END.
IF ERROR-STATUS:ERROR THEN DO:
MESSAGE ERROR-STATUS:GET-MESSAGE(1).
END.

DELETE OBJECT hAsynCall NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
MESSAGE ERROR-STATUS:GET-MESSAGE(1).
END.



I don't know how can i write a sample program for this. sorry for the convenience. Great answers welcome here

Continue reading...
 
Status
Not open for further replies.
Top