Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1081187

Summary: Process Instance(s) view not working.
Product: [Retired] JBoss BPMS Platform 6 Reporter: Marek Baluch <mbaluch>
Component: Eclipse ToolingAssignee: Kris Verlaenen <kverlaen>
Status: CLOSED NOTABUG QA Contact: Marek Baluch <mbaluch>
Severity: high Docs Contact:
Priority: medium    
Version: unspecifiedCC: mbaluch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-01 17:59:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screenshot none

Description Marek Baluch 2014-03-26 17:32:09 UTC
Description of problem:
When I select a ksession object in the debug view then the Process Instance/Instances views remain empty. See attached screenshot.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Create a new jBPM Project
2. Attempt to debug the process as described in http://docs.jboss.org/jbpm/v6.0/userguide/jBPMEclipseJBPM.html#d0e12658

Actual results:
Process instance/instances views are empty

Expected results:
Process instance/instances views show the active processes.

Comment 1 Marek Baluch 2014-03-26 17:32:39 UTC
Created attachment 879133 [details]
screenshot

Comment 2 Kris Verlaenen 2014-03-27 12:15:38 UTC
Marek, which project are you using for this?  Note that the process instances view currently only shows process instance that are in memory, so when using persistence (where process instances will be stored in the database at the end of each command), the process instances view will be empty in between calls.

Comment 3 Marek Baluch 2014-03-27 12:22:43 UTC
Kris,

I found this issue using the mavenized jBPM Project.

Steps:
1) Create 'jBPM project (Maven)'
2) Add a break point into the generated Java code
3) In the 'variables' view of the Debug perspective select 'ksession'.
4) Switch to the Process Instances view for example.

I suspect this will be the case for the plain 'jBPM project' too. I will try to make sure.

Comment 4 Marek Baluch 2014-03-27 12:26:46 UTC
Yep - it's the same. Doesn't even matter weather I use debug as 'drools junit test' or just 'junit test'.

Comment 5 Kris Verlaenen 2014-04-01 01:43:53 UTC
Marek,

I just tried with 6.0.1.Final and it's working as expected there.

Two important remarks:

(1) to see process instances (between different invocations on the ksession), persistence needs to be turned off, otherwise the process instances will be stored in the db an released at the end of each command, so the view will be empty once you hit the breakpoint

(2) you can only see active process instances (even when not using persistence), as completed process instances are no longer relevant for execution and thus removed

The easiest way to get the process instance view working is: New -> Project -> jBPM Project and in the second wizard page select "a more advanced process using human tasks and persistence".  In the generated ProcessTest constructor, change the super constructor to super(true, false) to turn of persistence and put a breakpoint right after ksession.startProcess(..)

Note that debug as drools junit test is only necessary for enabling drools rule breakpoints (it has no effect when debugging pure jbpm).

While we can look at improvements / enhancements, it seems the view is working as expected though.

Comment 6 Marek Baluch 2014-04-01 17:59:27 UTC
OK - this is my fault - I've been using it the wrong way and did not pay attention to the NOT USE PERSISTENCE part. My apologies.

This works as expected also with the maven type project. All that is required is to change:

RuntimeEnvironmentBuilder builder = RuntimeEnvironmentBuilder.Factory.get()
			.newDefaultBuilder().entityManagerFactory(emf)
			.knowledgeBase(kbase);

to 

RuntimeEnvironmentBuilder builder = RuntimeEnvironmentBuilder.Factory.get()
			.newDefaultInMemoryBuilder()
			.knowledgeBase(kbase);

Thanks Kris!