Bug 1024358 - REST Endpoint ISSUE with ksession.getProcessInstances()
REST Endpoint ISSUE with ksession.getProcessInstances()
Status: CLOSED CURRENTRELEASE
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity high
: ER5
: 6.0.0
Assigned To: Marco Rietveld
Ivo Bek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-29 10:02 EDT by Mauricio Salatino
Modified: 2016-09-20 01:05 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:12:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mauricio Salatino 2013-10-29 10:02:55 EDT
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 07:50:57 EST
Verified in BPMS 6.0.0.ER5

Note You need to log in before you can comment on or make changes to this bug.