Release 10.1A: OpenEdge Development:
ADM and SmartObjects

> ## Writing local event procedures and functions

> An event procedure is a procedure that executes when a particular event occurs. This is sometimes accomplished through the `PUBLISH`/`SUBSCRIBE` functionality, as follows:

> 1. SmartObjects that need to know about an event `SUBSCRIBE` to the event. (The `addLink` procedure does this at startup.)

> 2. When an event occurs, a SmartObject `PUBLISH`es the event.

> 3. This action notifies all subscribing SmartObjects that the event occurred.

> Sometimes, however, this happens simply when a SmartObject `RUN`s an internal procedure or invokes a user-defined function. In either case, the procedure or function being executed normally is implemented in a separate super procedure. See the "Super procedures" section.

> The super procedure functionality allows you to write a local version of an ADM internal procedure or function in a SmartObject master procedure file that augments or overrides default ADM events. When the ADM runs an internal procedure or function, Progress 4GL looks at the SmartObject and its super procedures, starting with a local version if there is one, and runs the first one it finds. If this super procedure performs a `RUN` `SUPER` or `SUPER( )`, the 4GL looks further up the super procedure chain to find the next version to run. A local version of an ADM procedure can execute code before, after, or instead of the more standard behavior of the internal procedures and functions in ADM super procedures.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095