Searching task by task variable

Hi, when using rest api, we need to select tasks by task variables, where variable is of type date.

I’d like to ask, if there is any other option than storing the variable in milliseconds from epoch, because in documentation, there is written following for the taskVariables query property. I am asking, because I can’t think of a problem with Date variable in this functionality.

A JSON array to only include tasks that belong to a process instance with variables with certain values.
The array consists of JSON objects with three properties name, operator and value. name is the variable name, operator is the comparison operator to be used and value the variable value.
value may be of type String, Number or Boolean.

Can you link to that doc?

The supported variables types are : https://docs.camunda.org/manual/7.7/user-guide/process-engine/variables/#supported-variable-values

Hi yes, camunda supports also dates to be process and task variables, however in rest api, there is specificaly mentioned String, Number and Boolean.

https://docs.camunda.org/manual/7.7/reference/rest/task/post-query/

@tomorrow looks like its just out of date docs:

24 AM

1 Like

hi, I am not sure if you understand me, where the problem is.

In your rest request, you’re sending correlation message, however I am talking about searching task by variable

POST {camunda}/task

{“processVariables”:
[{“name”: “myDate”,
“value”: “2017-10-02T01:01:01”,
“operator”: “eq”
}]}

For your process, the task placeholder should be searched.

@tomorrow

You can still query for a specific Date:

24 AM

You cant do after,before, etc date operators without using number (epoch or another format)