Bug 1024358 - REST Endpoint ISSUE with ksession.getProcessInstances()
Summary: REST Endpoint ISSUE with ksession.getProcessInstances()
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER5
: 6.0.0
Assignee: Marco Rietveld
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-29 14:02 UTC by Mauricio Salatino
Modified: 2016-09-20 05:05 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:12:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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


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