cancel
Showing results for 
Search instead for 
Did you mean: 

List of process instances via REST returns empty processvariables

trond_nordli
Champ in-the-making
Champ in-the-making
I'm trying in the latest version 5.13 of Activiti to access process-instances via REST-API. It works well except the processvariables is missing.

It works on list of task as expected:

/runtime/tasks?includeProcessVariables = true

But don't work on list of process:

/runtime/process-instances?includeProcessVariables = true
Where you only get blank values ​​"variables": []
And the processvariables can successful be accessed thru variable directly.

/runtime/process-instances/{processId}/variables/{variable}

Regards

-
Trond
9 REPLIES 9

frederikherema1
Star Contributor
Star Contributor
Seems that the docs are not up to date with the actual implementation. The includeProcessVariables is ignored, so that's why the list is empty…

trond_nordli
Champ in-the-making
Champ in-the-making
Thanks for the answer, looking forward to a version which has implemented this.

Regards

-
Trond

frederikherema1
Star Contributor
Star Contributor
This is fixed on master, so the next version that is released will contain this functionality.

ssun
Champ on-the-rise
Champ on-the-rise
I'm on 5.14 and still see the same thing.
I'll try 5.15 to see if it is fixed.

ssun
Champ on-the-rise
Champ on-the-rise
Nope! Update to 5.15 did not work at all. The variables is always an empty array! We need to make one extra call with /variables added to the end of process instance or task url. Can we fix this and avoid making a lot of calls when list process instances or tasks?

Thank you!

ssun
Champ on-the-rise
Champ on-the-rise
I downloaded the latest source code from here https://github.com/Activiti/Activiti/tree/master/modules/activiti-webapp-rest2
I built a war file and it does not list variables at all.
Also somehow the one I build returns XML instead of JSON.

–Gordon

ssun
Champ on-the-rise
Champ on-the-rise
I take back my previous comments. Added ?includeProcessVariables=true worked, I mistakenly added includeVariables Smiley Sad

siddu
Champ in-the-making
Champ in-the-making
Team,
I am also finding this issue. I tried rest call

http://localhost:8080/activiti-rest/service/runtime/process-instances?includeProcessVariables =true

Request payload
———————
  {
"processDefinitionKey": "cancel_order_call_workflow",
"businessKey": "2456859",
"variables": [{
  "name": "reason_code",
  "value": "Not_Interessted"
},
{
  "name": "user_intent",
  "value": "return"
},
{
  "name": "account_no",
  "value": "123"
},
{
  "name": "client_no",
  "value": "123"
}]
}

Response
———–
<ProcessInstanceResponse>
<id>9515092</id>
<url>
       http://localhost:8080/activiti-rest/service/runtime/process-instances/9515092
</url>
<businessKey>2456859</businessKey>
<suspended>false</suspended>
<ended>true</ended>
<processDefinitionId>cancel_order_call_workflow:1:9485004</processDefinitionId>
<processDefinitionUrl>
        http://localhost:8080/activiti-rest/service/repository/process-definitions/cancel_order_call_workflo...
</processDefinitionUrl>
<activityId>cancelWorkflowEnd</activityId>
<variables/>
<tenantId/>
<completed>true</completed>
</ProcessInstanceResponse>

—————————————–
Here I am trying to return some value from my workflow and include that as part of my response( in <variables/>)

Please help me out - I am new to activiti

Thanks in advance
Siddu.

jbarrez
Star Contributor
Star Contributor
I'm  not following here: are you sating the includeProcessVariables does not return the variables in the response?