First, we should configure RulesComposer to use the Debug Hierarchy tool.
- Select menu command Window > Preferences,
- Expand node RulesComposer and then node Rules Development, finally the page Run/Debug

- Now, select option Create debug hierarchy and press Apply,
- Press Ok to close the window.
Now, we can use the debug facilities of the RulesComposer to analyze the flow of the generation:
- Click Run > Debug and choose the last launched configuration.
- Show the Report view.
- Right-click the file Order.java in this view.
- 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:
- Select the node main\JavaSource [Order.java] in the debug hierarchy Debug Nodes section.
- Select the node Result\result in the Properties section.
- Select the text productName in the details pane, bottom part of the Properties section.
- Right-click to open the context menu.
- 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 rhapsody.Argument whose evaluation produced the text "RhpString
productName".
The debug hierarchy is very useful in two situations:
- You want to find the script that generated a part of a file in a complex generation.
- You want to see the flow (debug nodes) of a complex generation to understand how the generator is built.
Next Section: Include a Javadoc template
Prev Section: Add operation body

Inspecting a debug
hierarchy