Bug 1057749 - REST API : /task/{taskId}/content returns null content
Summary: REST API : /task/{taskId}/content returns null content
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: 6.0.1
Assignee: Marco Rietveld
QA Contact: Tomas Livora
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-24 17:59 UTC by Bernard Tison
Modified: 2016-09-20 05:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:02:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
kjar containing process with human task (8.57 KB, application/x-java-archive)
2014-01-24 17:59 UTC, Bernard Tison
no flags Details

Description Bernard Tison 2014-01-24 17:59:06 UTC
Created attachment 855125 [details]
kjar containing process with human task

Description of problem:

the rest API call /task/{taskId}/content returns null content


Version-Release number of selected component (if applicable):
BPMS 6.0.0.CR1


How reproducible:
Consistently


Steps to Reproduce:
1. make sure the user has role 'Reviewer'
2. Log in into BPMS
3. Deploy the attached kjar (contains a very simple process with a human task)
4. In the BPMS UI, start an instance of the UserTask process - this will create a new task. Verify the taskId in the task tab.
5. In a command window, issue the following command:

curl -HAccept:application/xml --user "<user>:<password>" "localhost:8080/business-central/rest/task/<taskId>/content"

(Replace <user> and <password> with the actual username and password, and <taskId> with the actual task id)

Actual results: nothing is returned from the call


Expected results: task content in xml format


Additional info: 

in org.kie.services.remote.rest.TaskResource, lines 272 - 280

        JaxbContent content = null;
        if( contentId > -1 ) { 
            cmd = new GetContentCommand(contentId);
            result = processRequestBean.doTaskOperationAndSerializeResult(
                    cmd, 
                    "Unable get content " + contentId + " (from task " + taskId + ")");
            content = (JaxbContent) content;
        } 
        return createCorrectVariant(content, headers);

line 278 should become

content = (JaxbContent) result;

instead of

content = (JaxbContent) content;

Comment 2 Marco Rietveld 2014-02-04 11:45:15 UTC
Bernard, thanks very much for both the catch and fix!

Comment 3 Marco Rietveld 2014-02-04 12:10:26 UTC
Fixed. Commits: 

6.0.x: 
https://github.com/droolsjbpm/droolsjbpm-integration/commit/96f4b40b

master: 
https://github.com/droolsjbpm/droolsjbpm-integration/commit/8e947118

(Integration) Tests added, as usual, to the kie-test repository: 
https://github.com/droolsjbpm/kie-tests/commit/122f5ddd
https://github.com/droolsjbpm/kie-tests/commit/bc77b213


(I also added a constructor to the RemoteJmsRuntimeEngineFactory that makes it simpler to construct a JMS based RemoteJmsRuntimeEngine).

Comment 4 Marek Baluch 2014-02-20 14:41:53 UTC
Verified on 6.0.1-ER1


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