Steps to setting up event-driven exchanges - advise links
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
This section describes how to set up event-driven exchanges.
To set up and manage event-driven exchanges for a data item:
- Specify
the server data item in a
DDE ADVISEstatement, using theSTARToption. This creates an advise link to the data item from ABL. From this point in the procedure, the DDE server monitors the specified data item, notifying ABL whenever its value changes. - Add an
ON DDE-NOTIFY OF FRAMEDDEframe statement, where DDEframe is the name of the frame that owns the conversation. In the trigger block for the statement, invoke theDDE GETstatement to retrieve the new value of the data item (just like aDDE REQUEST) and process it as you want. ABL triggers thisDDE-NOTIFYevent and posts it to the appropriate DDE frame when notified of the value change. The OpenEdge client application then executes the event trigger when it blocks for I/O or invokes thePROCESS EVENTSstatement. If you have more than one advise link established for the conversation, you can determine what data item changed by checking the value of theDDE-ITEMattribute of the DDE frame.Note: In general, do not block for I/O (for example, invoke anUPDATEstatement) or invoke aPROCESS EVENTSstatement within the trigger for aDDE-NOTIFYevent. This can cause ABL to update the DDE frame attributes for a newDDE-NOTIFYevent before you have completed the processing for a prior event. - At any point in the procedure, if you want to stop event-driven exchanges
for the data item, specify the data item in a
DDE ADVISEstatement using theSTOPoption. This removes the advise link and directs the server to cease monitoring value changes in the data item. This does not terminate the conversation in any way and you can continue to access the data item with other exchanges or create another advise link to the data item.