Madhu
Madhu

Reputation: 73

Camunda returning incorrect list of tasks using task variables

I have a use case where I am using a BPMN parallel multi-instance task to create multiple tasks once a form is submitted. The multi instance task is creating the individual tasks with the variable values. I can also see the element variable value is added to all the tasks.

enter image description here

I am starting the process using REST API. My api request body is

{ "businessKey":"1", "messageName": "start", "processVariables" : { "var1" : {"value" : "1", "type": "string"}, "var2": {"value" : "[\"1\",\"2\",\"3\"]", "type": "Object", "valueInfo" : { "objectTypeName": "java.util.ArrayList", "serializationDataFormat": "application/json" } } } }

However when I try to query the task list using task variables, the api returns empty response. I have checked in both Camunda Tasklist page as well as the API engine-rest/task/{taskId}/variables.

I tried querying for task list using both the GET and POST task list options.

 `GET: /engine-rest/task?processInstanceBusinessKey=1&taskVariables=val_eq_2
    POST: /engine-rest/task
    Body: 
    {
    "processInstanceBusinessKey": "1",
    "taskVariables":
        [{"name": "val",
        "value": "2",
        "operator": "eq"
        }]
    }

Response: []`

If the task variable is present why is the api not returning tasks based on the task variable name?

Upvotes: 0

Views: 1345

Answers (1)

rob2universe
rob2universe

Reputation: 7583

I also came across this again today. You seem to have run into a bug.

This is my test case: https://github.com/rob2universe/cam-multi-instance/blob/25f524be6a112deb1b4ae3bb4f28a35422e428e0/src/test/java/org/camunda/bpm/example/ProcessJUnitTest.java#L58

and the ticket I created: https://jira.camunda.com/browse/CAM-12580

Upvotes: 1

Related Questions