How do I call the procedure section from window application using asynchronous method on progress 4GL?

Thiru

I want to use Asynchronous method but the problem is when I write a query like below then program read only main block and definition section and it's not entered into procedure section. I want to read that too.

DEFINE VARIABLE hAsynCall     AS HANDLE      NO-UNDO.

ASSIGN cPgmTest = Test.p

RUN VALUE(cPgmTest) ON SERVER gshAstraAppserver ASYNCHRONOUS
    SET hAsynCall (INPUT 'Csv') NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
   MESSAGE ERROR-STATUS:GET-MESSAGE(1).
END.


DO WHILE NOT hAsynCall :COMPLETE:

  PROCESS EVENTS.

  IF hAsynCall :COMPLETE THEN

    MESSAGE "completed"        
      VIEW-AS ALERT-BOX INFORMATION.

  ELSE /* Async result not ready, so do something else. */
    MESSAGE "Not yet ..." VIEW-AS ALERT-BOX INFORMATION.

END. 

/* Test.p*/

  /* Definition*/

  /*Main Block*/
    DEFINE INPUT PARAMETER cData AS CHARACTER NO-UNDO.
    PAUSE 5.

  /*Procedure*/

  /*Function*/

As you see above the program was read up to main block but if i cut the query from main block and paste into procedure block then its doesn't not entered.

Stefan Drissen

You need to run your AppServer procedure persistently and then run the asynchronous call in that.

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvref%2Frun-statement.html

Something like:

DEFINE VARIABLE hp AS HANDLE NO-UNDO.

RUN test.p PERSISTENT SET hp.
RUN whatever IN hp ASYNCRHONOUS SET hasync ( "csv" ).

FINALLY:
   DELETE OBJECT hp.
END FINALLY.

Note that this pattern incurs two additional AppServer calls, a proxy stub can be used to prevent this.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to increase the performance for a module running parallely (using asynchronous method) in Progress 4gl Appserver?

How do I get the latest file from a directory in Progress 4gl?

How do I count total lines and create new/Select sheet in one csv file using progress 4GL?

Progress 4GL: How to find where a procedure is defined

How do I do a case/switch query with Progress 4GL 9.1D?

Make a Java Call from within Progress 4gl

How can I access more than 1 element from a field in Progress 4GL

How can i get the same result in Progress 4gl?

How to test if string is numeric using Progress 4GL

OpenEdge Progress-4GL development: how to know from an error message the procedure I'm running?

How can I call an asynchronous method using the Geolocation API?

How can I call an asynchronous method from WndProc?

How to call an Asynchronous Method in the background of a Xamarin application

How to call a synchronous method from an asynchronous method

How do I make an asynchronous call using AngularJs and Typescript

How to match a records in progress 4GL?

How do I return the response from an asynchronous call?

How do I call a method on my WPF Page from the Modal Window?

How do I tell an array from a procedure call?

How can i make database access fast of progress 4gl

Progress 4GL: How to generate different log file name when multiple processes using the same Timestamp?

How to calculate yesterday records with today records using progress 4gl?

How to read a XML file and export an item using Progress 4GL

how to apply last key from a program itself without requiring a user input? - PROGRESS 4GL

How add only required fields from table to dynamic temp table? - PROGRESS 4GL

how to add and display specific records from code_mstr to temp-table in progress 4gl?

How to get chosen value from combo-box as variable PROGRESS 4GL

How do I show a progress window?

Spring: How do I call a method only when in web application?

TOP Ranking

HotTag

Archive