Bug 1017057 - Parameters are not passed when completing task through REST API
Parameters are not passed when completing task through REST API
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: 6.0.0
Assigned To: Marco Rietveld
Marek Baluch
Depends On:
  Show dependency treegraph
Reported: 2013-10-09 04:24 EDT by Tomas Livora
Modified: 2016-09-20 01:05 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-18 07:48:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Tomas Livora 2013-10-09 04:24:23 EDT
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 07:46:07 EDT
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. 

Comment 3 Tomas Livora 2013-10-11 04:52:14 EDT
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 09:28:56 EDT

Thanks very much, this is exactly the information I needed.
Comment 5 Marco Rietveld 2013-10-17 08:33:54 EDT
I can't reproduce this problem, Tomas. 

See this test: 


How are you verifying that the process instance variable 'userName' doesn't have the correct value?
Comment 6 Tomas Livora 2013-10-18 07:48:38 EDT
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.