skip to main content
OpenEdge Development: ADM and SmartObjects
Advanced ADM Topics : Monitoring SmartObject applications
Monitoring SmartObject applications
ADM provides several OpenEdge PRO*Tools for monitoring SmartObject applications:
*Procedure Object Viewer
*The Application Debugger
*Pro*Spy Plus
Procedure Object Viewer
The Procedure Object Viewer keeps track of all procedures you run in your Progress session and displays information about procedure objects. You can use the information and options that this tool provides to manage procedures when you work with SmartObject applications. You can also make use its information when you are using the Debugger.
Starting the Procedure Object Viewer
The Procedure Object Viewer is accessible from the AppBuilder’s PRO*Tools palette. To open the PRO*Tools palette, choose ToolsPRO*Tools from the AppBuilder main window. Figure 6–1 shows the PRO*Tools palette and identifies the Procedures Object Viewer icon.
Figure 6–1: Procedure Object Viewer icon on PRO*Tools palette
Clicking this icon opens the Procedure Object Viewer, shown in Figure 6–2.
Figure 6–2: Procedure Object Viewer
Viewing procedure objects
The Procedure Object Viewer lets you see immediately what internal procedures are available for a SmartObject and what their parameters are. As shown in Figure 6–3, its Procedure Objects selection list displays a list of all procedures you run in your Progress session. When you select a procedure from this selection list, the Internal Entries selection list displays all internal procedures available in the external procedure. Similarly, when you select an entry from the Internal Entries selection list, the Parameters selection list displays a list of the entry’s parameters.
Figure 6–3: Selecting procedure objects and internal entries
The Procedure Object Viewer application does not merely display information. It also lets you:
*Run an internal procedure inside of a procedure object to see its effect, provided that the procedure does not take parameters.
*Look at a SmartObject’s SmartInfo dialog box and view the SmartObject’s properties.
By default, the Procedure Object Viewer views all procedures running persistently in a Progress session except those used by the Progress tools and those SmartObjects that are in design mode. If you want to see SmartObjects in design mode, choose ViewHide UIB-Mode Objects.
The Application Debugger
The Debugger enables you to move automatically from object to super procedure, and from event publisher to subscriber. You can use this tool to follow the flow of control among the persistent procedures that make up an application.
To begin a debugging session for a SmartObject application:
1. Choose a starting point for a debugging session by picking the event procedure where you want to start tracking the program flow. You can find this procedure in the Procedure Object Viewer.
2. Create a local version of that event procedure or function in the SmartObject where you want to begin tracing behavior.
3. In that procedure or function, insert the following statements before the RUN SUPER statement:
4. Save this object and run the SmartWindow that contains it. The Debugger starts up the first time that procedure or function executes.
5. When the Debugger starts up, use the STEP command, which causes the Debugger to step into the super procedure version of that same procedure. This effectively puts a breakpoint at the start of an internal procedure or function in a super procedure without the necessity of editing the super procedure itself.
Alternatively, if you run your Progress session with the -debugalert startup option, you can simply code a message statement in Step 3, instead of explicitly invoking the Debugger. For example:
MESSAGE "proc-name".
Then, when you run your application and the message alert box appears, press the HELP button to see a stack trace of the Progress 4GL code and determine where you are in the application. If you now press the Debug button on the stack trace window and the OK button on the original message alert box, Progress invokes the Debugger to allow you to move through the application from that point. (If you do not want to enter the Debugger, do not press the Debug button.)
Debugger tips
Here are some useful notes for using the Debugger:
*When the Debugger is at a RUN SUPER statement, a STEP command steps into the code in the next super procedure up the chain.
*When the Debugger is at a PUBLISH statement, a STEP command steps into the event procedure in the first subscriber for that event. Continuing to STEP or NEXT through the code walks through all subscribers to that event.
*To display what procedure is executing, use the THIS-PROCEDURE:FILE-NAME expression.
*To display the name of the SmartObject on whose behalf a super procedure routine is executing, use the TARGET-PROCEDURE:FILE-NAME expression.
*To display the name of the calling procedure, use the SOURCE-PROCEDURE:FILE-NAME expression.
*To ensure the Debugger has access to all procedures you want to walk through, add the %DLC%\src (Windows) or $DLC/src (UNIX) directory to the PROPATH after the gui directory.
Pro*Spy Plus
Pro*Spy Plus is an OpenEdge PRO*Tool whose primary function is to serve as a training and debugging aid for use when developing SmartObject applications. Specifically, this tool logs execution flow information for the application and provides it to the developer. This section provides a brief overview of Pro*Spy Plus. For complete details on its use, see the online help.
Pro*Spy Plus supports the:
*Hierarchical display of program call data in the Pro*Spy Plus window. This tree view presentation allows you to drill down, backtrack into an application's call flow, and trace application execution. This functionality allows you to quickly investigate and determine where processing might have gone astray. The Pro*Spy Plus window also supports a find feature that is associated with its browser pane.
*Definition of a criteria by which you can search through, or filter, a trace you can initiate on a call stack. Using the Filter dialog box, you build filter criteria to inspect specific elements in a call stack and display the criteria's results in this window's browse.
Pro*Spy Plus is accessible from the AppBuilder’s PRO*Tools palette. To open the PRO*Tools palette, choose ToolsPRO*Tools from the AppBuilder main window. Figure 6–4 shows the PRO*Tools palette and identifies the PRO*Spy Plus icon.
Figure 6–4: Pro*Spy Plus icon on PRO*Tools palette
Clicking this icon opens the Pro*Spy Plus window, shown in Figure 6–5.
Figure 6–5: Pro*Spy Plus window
This window includes a menu bar and a toolbar. In the menu bar, you can (among other things) open an existing log file to view it in the hierarchical tree view section. Using buttons on the toolbar, you enable and disable the logging of call stack information. The rest of the window displays the results of the current recording.
For more information, see the Pro*Spy Plus online help.