JBoss Developer Studio can validate and debug processes.
Validation
To validate a process, right click the .bpmn file and select Validate.
If validation completes successfully, a dialogue box will appear stating there are no errors or warning.
If validation is unsuccessful, the errors will display in the Problems tab. Fix the problems and rerun the validation.
Debug
To debug a process, right click the .bpmn file and select → ; make any required changes to the test configuration and click Debug.
If no errors are found, the process will execute.
If errors are encountered, they will be described in the bottom window of JBoss Developer Studio. Fix the errors and rerun the debug process.
14.9.1. 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 14.10. The Debug Perspective
Open the Process Instance view
Select under the category
Use a Java breakpoint to stop your application at a specific point (for example, after starting a new process instance).
In the Debug perspective, select the ksession you would like to inspect.
The Process Instances view will show the process instances that are currently active inside that ksession.
When double-clicking a process instance, the process instance viewer will graphically show the progress of that process instance.
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".
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.
14.9.2. Debugging Views in JBoss Developer Studio
14.9.2.1. The Process Instances View
The process instances view shows the currently running process instances.
To open the process instances viewer, select → → , then select → .
The Sample Process Instances View below shows that there is currently one running process (instance), currently executing one node instance, i.e. business rule task. When double-clicking a process instance, the process instance viewer will graphically display the progress of the process instance.
Example 14.1. Sample Process Instances View
14.9.2.2. The Human Task View
The Human Task View can connect to a running human task service and request the relevant tasks for a particular user (i.e. the tasks where the user is either a potential owner or the tasks that the user already claimed and is executing). The life cycle of these tasks can then be executed, i.e. claiming or releasing a task, starting or stopping the execution of a task, completing a task, etc.
To open the human task viewer, select → → , then select → .
To configure the task service to connect to, select → → and enter the IP address, port, and language.
Example 14.2. Sample Human Task View
The audit view shows the audit log, which is a log of all events that were logged from the session. To create a logger, use the KnowledgeRuntimeLoggerFactory to create a new logger and attach it to a session. Note that using a threaded file logger will save the audit log to the file system at regular intervals, and the audit viewer will then be able to show the latest state. The Threaded File Logger below shows an example with the audit log file and the interval (in milliseconds) specified.
Example 14.3. Threaded File Logger
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory
.newThreadedFileLogger(ksession, "logdir/mylogfile", 1000);
// do something with the session here
logger.close();
To open the audit view, select → → .
To open up an audit tree in the audit view, open the selected log file in the audit view or simply drag the file into the audit view. A tree-based view is generated based on the audit log. An event is shown as a sub node of another event if the child event is caused by (a direct consequence of) the parent event:
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.