Bug 1017057 - Parameters are not passed when completing task through REST API
Summary: Parameters are not passed when completing task through REST API
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 6.0.0
Assignee: Marco Rietveld
QA Contact: Marek Baluch
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-09 08:24 UTC by Tomas Livora
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: 2013-10-18 11:48:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Simple user task with one input and output parameter (11.58 KB, application/xml)
2013-10-09 08:24 UTC, Tomas Livora
no flags Details

Description Tomas Livora 2013-10-09 08:24:23 UTC
Created attachment 809753 [details]
Simple user task with one input and output parameter

Description of problem:

I use REST API to run a simple process (attached) and when I try to complete the human task the given parameters are not passed. In this process there is one process variable 'userName' which is mapped to the human task input parameter 'inUserName' and output parameter 'outUserName' is mapped back to the process variable 'userName'. 

When starting the process I set the process variable value. Then I start the human task and when completing this task I pass the different value as output parameter. But after that when I print the process variable there is the original value instead of expected value passed as task output parameter. I try to pass the parameter with name 'outUserTask' as well as 'map_outUserTask' but none of these works.

This problem seems to appear only when using REST API. I am able to successfully pass the task output parameters and get the expected behaviour with Java Remote API.

Comment 1 Marco Rietveld 2013-10-10 11:46:07 UTC
Hi Tomas, 

Thanks for finding this! 

Unfortunately, whenever I try to solve a bug, it's *absolutely* necessary that I have the exact information to be able to solve it. 

At the very least, could you include the exact REST calls that you're making? Also, the exact order in which you're doing things would be great (in other words: "Steps to Reproduce"). 

If possible, please always try to include as much information as possible in the bugzilla. 

Thanks!!

Comment 3 Tomas Livora 2013-10-11 08:52:14 UTC
Hi Marco,

as I use our own (QA) class to control REST calls it is quite difficult for me to decide how much to the depth I should explain those steps:

1. Create a client request (org.jboss.resteasy.client.ClientRequest) with URL 'http://localhost:8080/business-central/rest/runtime/org.jboss:integration:1.0.0.Final/process/org.jboss.qa.bpms.HumanTaskWithForm/start', add form parameter 'map_userName' with value 'John' and post this request to start the process.

2. Create another client request with URL 'http://localhost:8080/business-central/rest/task/{taskId}/start' (where taskID is the ID of the human task) with no parameters and post this request to start the human task.

3. Then create a client request with URL 'http://localhost:8080/business-central/rest/task/{taskId}/complete', add form parameter 'map_outUserName' with value 'George' and post this request to complete the human task.

4. Now if you check the process instance variable 'userName' its value will be 'John' instead of expected 'George'.

As I said I am not sure if I explained this steps the way you want so feel free to ask for more information.

Comment 4 Marco Rietveld 2013-10-11 13:28:56 UTC
Tomas, 

Thanks very much, this is exactly the information I needed.

Comment 5 Marco Rietveld 2013-10-17 12:33:54 UTC
I can't reproduce this problem, Tomas. 

See this test: 

https://github.com/droolsjbpm/kie-tests/blob/6.0.x/kie-wb-tests/kie-wb-tests-base/src/main/java/org/kie/tests/wb/base/methods/RestIntegrationTestMethods.java#L361

How are you verifying that the process instance variable 'userName' doesn't have the correct value?

Comment 6 Tomas Livora 2013-10-18 11:48:38 UTC
It is not a bug. The problem is in the class we use to control REST calls. The method for getting process variable returns the oldest variable value from the variable history instead of its actual value.


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