Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

4.3. Debugging

  1. Drools breakpoints are only enabled if you debug your application as a Drools Application. To do this you should perform one of two actions:
    • Select the main class of your application. Right-click on it and select Debug AsDrools Application .
    • Alternatively, select Debug AsDebug Configuration to open a new dialog window for creating, managing and running debug configurations.
      Select the Drools Application item in the left tree and click the New launch configuration button (leftmost icon in the toolbar above the tree). This will create a new configuration with a number of the properties already filled in based on main class you selected in the beginning. All properties shown here are the same as any standard Java program.

    Note

    Remember to change the name of your debug configuration to something meaningful.
  2. Click the Debug button on the bottom to start debugging your application.
  3. After enabling the debugging, the application starts executing and will halt if any breakpoint is encountered. This can be a Drools rule breakpoint, or any other standard Java breakpoint. Whenever a Drools rule breakpoint is encountered, the corresponding .drl file is opened and the active line is highlighted. The Variables view also contains all rule parameters and their value. You can then use the default Java debug actions to decide what to do next (resume, terminate, step over, etc). The debug views can also be used to determine the contents of the working memory and agenda at that time as well (the current executing working memory is automatically shown).