10.3. Using the Debug Perspective

In the Red Hat JBoss Developer Studio with Red Hat JBoss BPM Suite plug-in, you can make use of the extended debugging feature (debugging allows you to visualize and inspect the current state of running process instances).
Note that breakpoints on Process elements are currently not supported. However, you can define breakpoints inside any Java code in your Process; that is, your application code that is invoking the engine or invoked by the engine, listeners, etc. or inside rules that are evaluated in the context of a Process.

Procedure 10.1. The Debug Perspective

  1. Open the Process Instance view Window > Show View > Other ...
  2. Select Process Instances and Process Instance under the Drools category
  3. Use a Java breakpoint to stop your application at a specific point (for example, after starting a new process instance).
  4. In the Debug perspective, select the ksession you would like to inspect.
  5. The Process Instances view will show the process instances that are currently active inside that ksession.
  6. When double-clicking a process instance, the process instance viewer will graphically show the progress of that process instance.
  7. Sometimes, when double-clicking a process instance, the process instance viewer complains that is cannot find the process. This means that the plug-in was not able to find the process definition of the selected process instance in the cache of parsed process definitions. To solve this, simply change the process definition in question and save again.
The screenshot below illustrates the running process instance with an id of "1". This example process instance relies on a human actor to perform "Task 1".
Example guide on how to use the Process Instances View

Figure 10.1. Process Instance in the Debugger

Note

The process instances view shows the process instances currently active inside the selected ksession. When using persistence, process instances are not kept in memory inside the ksession; that is, they are stored in the database as soon as the command completes. Therefore, you will not be able to use the Process Instances view when using persistence. For example, when executing a JUnit test using the JbpmJUnitBaseTestCase, make sure to call "super(true, false);" in the constructor to create a runtime manager that is not using persistence.
The environment provides also other views that are related to rule execution like the working memory view, the agenda view, etc. For further information, refer to the Red Hat JBoss BRMS documentation.