Debugging Message Transformations

Creating a Debug Configuration

To create a new debug configuration:

  1. In the main menu select Open Debug Dialog.

  1. In the debug dialog set the configurations for Message Processing Test and Message Transformation Test as described in the preceeding chapter Launching Message Transformations.
  2. Select Debug to start the debug process.

Starting the Debugger
Figure: Starting the Debugger

To work in the debugger, switch to the Debug perspective:

  1. In the main menu select Window > Open Perspective > Other.
  2. Select Debug and OK the dialog.

Open the Debug Perspective.
Figure: Open the Debug Perspective.

The Message Transformation Debug View

In the Message Transformation Debug View you can set or delete breakpoints and follow the debugging process in the Mapping Expression editor.

The Message Transformation Debug View
Figure: The Message Transformation Debug View

Setting and Clearing Breakpoints

Breakpoints can be set at the following locations:

  1. on a composite field
  2. on a leaf field

Setting Breakpoints on a Composite Field

If breakpoints are set on a composite field of the target message, this will cause the debugger to stop at the first mapping statement (if defined) or the mapping expression of all (recursive) leaf fields of the composite field.

Setting a Breakpoint in a Composite Field
Figure: Setting a Breakpoint in a Composite Field

Setting Breakpoints on a Leaf Field

Setting breakpoints on a leaf field will cause the debugger to stop at the first mapping statement (if defined) or the mapping expression of the leaf field.

Setting a Breakpoint in a Composite Field
Figure: Setting a Breakpoint in a Composite Field

The Variable Watch View

The Variable Watch view contains a tree table which displays the properties of all available variables and other tree entries showing the local variables.

The This Entry

The properties of the current object are displayed in the this tree entry. If a property is itself a JavaScript object, the property may be expanded to show its sub-properties. The entries in the this tree are updated each time control returns to the debugger or when you change the stack location in the Stack view.

This Table
Figure: The this Variable Entry

Local Variables

The local variables of the current function are displayed in the other nodes in the variables view. If a variable is itself a JavaScript object, the variable may be expanded to show its sub-properties. The entries are updated each time control returns to the debugger or when changing the stack location in the Stack view.

Local Variables
Figure: Local Variables Entry

The Expressions View

The Expressions view provides the possibility to watch and evaluate variables and expression.

Watching

Arbitrary JavaScript expressions may be entered in the Expressions view. The expressions you enter are re-evaluated in the current scope and their current values are displayed each time when control returns to the debugger or when changing the stack location in the Stack view.

Add a Watch Expression
Figure: Add a Watch Expression

Enter an Expression.
Figure: Enter an Expression.

Evaluating

The Expressions view contains an editable command line where you may enter arbitrary JavaScript code. The code is evaluated in the context of the current stack frame. The view maintains a history of the commands you have entered. You may move backward or forward through the history by pressing the Up or Down arrow keys on the keyboard.

The Breakpoint View

The breakpoint view displays the breakpoints set for fields and expressions:

The breakpoint View
Figure: The breakpoint View

With the checkbox on the left side you can enable or disable a breakpoint.

Java exception breakpoints can be set for specific exceptions:

Add Java Exception Breakpoint
Figure: Choose a Java Exception to set as Breakpoint.

The Stack View

The Stack view displays the current JavaScript call stack.

The Stack View
Figure: The Stack View

Controlling Execution

The debugger provides the following facilities to control the execution of scripts during debugging:

Stepping Into

To single step entering any function calls, you may do any of the following:

Execution will resume. If the current line in the script contains a function call, control will return to the debugger upon entry into the function. Otherwise control will return to the debugger at the next line in the current function.

Stepping into a Function
Figure: Stepping into a Function

Stepping Over

To single step to the next line in the current function, you may do any of the following:

Execution will resume but control will return to the debugger at the next line in the current function or top-level script.

Stepping Out

To continue execution until the current function returns you may do any of the following:

Execution will resume until the current function returns or a breakpoint is hit.

Resume

To resume execution of a script you may do any of the following:

Execution will resume until a breakpoint is hit or the script completes.

Suspend

To stop all running scripts and give control to the debugger you may do any of the following:

Terminate

To terminate the debugging process you may do any of the following:

Terminated Process in the Stack View
Figure: Terminated Process in the Stack View

Suspend on Exceptions

To give control to the debugger whenever a JavaScript is exception is thrown, select the Run > Suspend on exceptions option from the menu bar. Whenever a JavaScript exception is thrown by a script a message dialog will be displayed and control will be given to the debugger at the location the exception is raised.

Right-click in the stack view and select Suspend on exceptions in the context-menu.


Figure: Suspend on Exceptions