Use the debug hierarchy

We will now use debug facilities of MDWorkbench to analyse the flow of the generation:

  1. Click Window > Preferences and MDWorkbench > Rules Development > Run/Debug
  2. Select the option Create debug hierarchy and click OK.
  3. Click Run > Debug Last Launched to launch the generation in debug mode.
  4. Show the Report view.
  5. Right-click the file Order.java in this view.
  6. Click Open Debug Hierarchy.

The debug hierarchy shows up in an editor. A debug hierarchy is a tree of nodes, each node representing an evaluated element (template, rule or script):

We will now find the script that generated a part of the file Order.java:

  1. Select the node main\JavaSource [Order.java] in the debug hierarchy Debug Nodes section.
  2. Select the node Result\result in the Properties section.
  3. Select the text productName in the details pane, bottom part of the Properties section.
  4. Right-click to open the context menu.
  5. Click Find Text in Children Nodes.

The debug hierarchy focus is moved to the node main\JavaSource\declaration\declaration. This is the script defined on uml21.Parameter whose evaluation produced the text "String productName".

The debug hierarchy is very useful in two situations:

Related tasks
Inspecting a debug hierarchy