Bug 1024358

Summary: REST Endpoint ISSUE with ksession.getProcessInstances()
Product: [Retired] JBoss BPMS Platform 6 Reporter: Mauricio Salatino <msalatin>
Component: Business CentralAssignee: Marco Rietveld <mrietvel>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: smcgowan
Target Milestone: ER5   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:12:32 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:

Description Mauricio Salatino 2013-10-29 14:02:55 UTC
Description of problem:
If you call Collection<ProcessInstance> processInstances = ksession.getProcessInstances();
when using the rest endpoints you end up with the following exception : 

Exception in thread "main" java.lang.ClassCastException: org.kie.services.client.serialization.jaxb.impl.task.JaxbTaskResponse cannot be cast to java.util.Collection
	at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.getProcessInstances(CommandBasedStatefulKnowledgeSession.java:135)
	at org.jbpm.simple.rest.client.SimpleRestClient.main(SimpleRestClient.java:44)




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


How reproducible:
Clone the jbpm playground (https://github.com/droolsjbpm/jbpm-playground/tree/master/jbpm-simple-rest-client) repository and open the jbpm-simple-rest-client

Add to the example the following lines:
        Collection<ProcessInstance> processInstances = ksession.getProcessInstances();
        for(ProcessInstance pi : processInstances){
            System.out.println("Process Instance: "+pi.getProcessId() + pi.getProcessName());
        }

Notice that if you don't try to use the process instance collection you will not get an error. Also notice that in order to reproduce this issue you  need to get running the KIE-WB. Due the fact that unit tests doesn't marshall all the data as a real client.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Ivo Bek 2013-12-13 12:50:57 UTC
Verified in BPMS 6.0.0.ER5