cancel
Showing results for 
Search instead for 
Did you mean: 

REST Task Query not working

thysmichels
Champ in-the-making
Champ in-the-making
I am trying to query task variables using the REST but no luck:

When I do:
http://sjcua01-dev.tlcinternal.com:8080/activiti/runtime/tasks/12700/variables

I get:

[{"name":"queueName","type":"string","value":"initialLoanReview","scope":"global"},{"name":"loanId","type":"string","value":"3333333333","scope":"global"}]


I now want to query tasks:
POST: http://sjcua01-dev.tlcinternal.com:8080/activiti/query/tasks
With JSON Body:

{
  "taskVariables" : [
    {
      "name" : "queueName",
      "value" : "initialLoanReview",
      "operation" : "equals",
      "type" : "string"
    }
  ]
}


Result:

{
    "data": [],
    "total": 0,
    "start": 0,
    "sort": "id",
    "order": "asc",
    "size": 0
}


This is not correct as as it should return at least 1 record. Any suggestions why it does not work?
4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I have checked similar jUnit test in the Activiti source code org.activiti.rest.service.api.runtime.TaskQueryResourceTest#testQueryTasksWithVariables.
Did you try to debug your request?

Regards
Martin

thysmichels
Champ in-the-making
Champ in-the-making
Worked when specifying processInstanceVariables:

<code>
{
   "processInstanceVariables" : [
    {
      "name" : "queueName",
      "value" : "initialLoanReview",
      "operation" : "equals",
      "type" : "string"
    }
  ]
}
</code>

muthaks
Champ in-the-making
Champ in-the-making
??

alexz
Champ in-the-making
Champ in-the-making
Hi,
I have exactly the same issue but i dont want to use "processInstanceVariables" instead of "taskVariables" because my variable will be shared by tasks that might be in the same process Instance.
-> My variable's  scope is local for that reason (and it won't appear in the process Instance variables).

So I really need the query to work with taskVariables.
Any ideas? Are we missing something to make the query work with "taskVariables" ?