RPE 1.3 Serviceability – The Debugger


The biggest and we hope the most important and useful serviceability improvement in RPE 1.3 is the Debugger. The debugger allows monitoring the document generation and inspecting the data and variables at any point.

debugger_1RPE Debugger – Click on the image to enlarge

The debugger is available in Document Studio,  works for local document generation only and cannot be attached to a running instance of RPE.

There are 5 areas in the Document Studio UI exposing the debugger functionality ( see the above image):

  1. The main toolbar has the debugger controls
  2. A status bar shows the status of the debugger (running or stopped on a breakpoint)
  3. The execution context gives an overview of the variables and data values at the breakpoint
  4. The details view shows the raw value as well as the XHTML source ( if that’s the case) of the selected variable or data source property
  5. A replica of the debug controls in the main toolbar made available in the Debug View

Steps for debugging a template

  1. The user defines one or more breakpoints.
  2. The user starts the debugger (F11).
    NOTE: at this point it is recommended to select the “Run in background” option from the document generation progress dialog.
  3. The debugger shows the progress by selecting the element currently processed by RPE.
  4. When an element with a breakpoint is reached the debugger will stop and the debug view will show the data and element context
  5. The user resumes the debugger using one of the 3 available options:
    1. Step Next – to move to the next template element
    2. Resume Debug – to move to the next breakpoint
    3. Resume Normal Execution  – to exit debug mode and allow RPE to complete the document generation at normal speed

A breakpoint can be set/removed through the main/debug view toolbars or by using the context menu of the element.

NOTE: breakpoints cannot be defined in master pages

debugger_5
Setting a breakpoint – Click on the image to enlarge

Functionality

The debugger supports the following:

  • Debug (F11) – starts RPE in debug mode enabling all the other capabilities
  • Resume Next (F6) – advances the debugger to the next element in the template. The debugger must be stopped on a breakpoint for this command to be active
  • Resume Debug (F8) – resumes the debugger. The debugger will stop on the next breakpoint or when the document generation is  finished.
  • Resume normal execution (Ctrl+F8) – resumes the execution and ignores all breakpoints
  • Toggle Breakpoint – toggles on/off a breakpoint on the currently selected elements. Breakpoints can be set on any number of elements. The debugger will pause the execution when the element is reached
  • Toggle Conditional Breakpoint – same as regular breakpoints but the debugger will only stop when the condition is met. Note that this condition is separate from any condition that might be defined on the template element and does not impact the output of the template
  • Clear all breakpoints – removes all the defined breakpoints

NOTE: when defining a conditional breakpoint one can use only the data properties already used in the template. The condition editor allows using all properties but due the debugger’s implementation element properties not specified in the template will not be resolved.

Inspecting the context

When the debugger stops on a breakpoint the user can inspect the element and the data context at that point. The data context is made of the template variables and the data elements visible at that location.

debugger_2
Debugger stopped on an element – Click on the image to enlarge

The information currently shown is the element ID, element type, current recursion level and information if the condition on the element passed or not (if a condition exists).

debugger_3
Data Context – Click on the image to enlarge

The user can select the variables and data properties to see their value, including the XHTML source where that’s available. The detailed view is especially interesting for data sources that have rich text ( XHTML).

debugger_4
Data Details – Click on the image to enlarge

Advertisements

Author: Dragos Cojocari

Architect for Rational Publishing Engine

2 thoughts on “RPE 1.3 Serviceability – The Debugger”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s