Filter for generic task variable values in tasklist API

We want to use the Tasklist API to get a list of tasks with generic variable values (i.e. “Camunda*”. Yet the Tasklist API offers only the equal operator to filter for task variables.

  "taskVariables": [    {      "name": "variable_name",      "value": "variable_value",      "operator": "eq"    }  ],

This is similar to the topic How to retrieve tasks filtered by custom process variable via Tasklist API (GraphQL or REST). Yet we require a pattern operator (something similar to the LIKE clause in SQL).

What is the best approach to filter tasks for patterns in task variables. Especially as the tasklist API does not return the task variables directly. We have to get the task variables of all found tasks and then filter for the required values on the client side. Besides this approach being tedious to implement, I assume that this approach will cause quite a load on the tasklist backend.

1 Like

Hi @JensBrauckhoff, welcome to the forums! The Tasklist API currently doesn’t support pattern matching (wildcards, LIKE, etc.). I’d be happy to take this feedback back to the product team. Can you share a bit more about why you’re doing a broad search for variables? It’s always helpful to have a use case to go along with the feedback!

Hi @nathan.loding ,

sorry for my late response. I wanted to clarify the use case with our customer before just dropping some artificial use case.

Our customer has a couple of thousand tasks of which each contains variables with a persons name (i.e Müller … yes, it’s in Germany). They want to have the ability to search for tasks with a certain generic name. If you search for Meier you certainly with to find tasks with the name Meier-Landrut in a certain variable value as well.

Does this description clarify the use case for you?

Thanks and regards,

          Jens

Thanks for the use case @JensBrauckhoff! I’ve sent this feedback along to the engineering team. There is a feature to support this, but it is still in the planning stages and there isn’t a release date set at this time.

Hi @JensBrauckhoff !

Thank you for your request.
We have these two requests (more filter operators + output of selected task variables) on our roadmap, and are working on the latter. You can expect them relatively soon.

Please let me know about anything else we can do to help you!

Best,
Christian

1 Like

Hi @christian-konrad and @nathan.loding ,

thank you very much for your quick feedback. That sounds very promising!

Regards,

    Jens
1 Like

Hi, did you get any news for this feature? Is it on the roadmap? Thanks!

Not yet. According to the tasklist-API documentation at Search tasks | Camunda 8 Docs there is still just an equality operator to search for task with certain variable values.
I wrote that post for a colleague who was on vacation at the time of my posting. As far as I know, they worked around that problem somehow by keeping track of the variable values and the according tasks outside of the tasklist (Elasticsearch). If I remember it correctly, they implemented an exporter to store the variables and the task in another database.

Holy moly. I think we gonna stick with version 7 for a while. It’s one road blocker after the other.

Thanks for the heads up!

Hey @YouriT and @JensBrauckhoff - yes, unfortunately we had to pivot a bit, and that changed the priority of some features. One thing we are working on with the upcoming 8.6 and 8.7 releases is fulfilling the promise of the unified REST API, and with that unified API we should see some changes around these filters, I believe. (I know this feature is currently in active development.)

Hi Nathan, thank for this feedback. We already assumed that you are pretty busy and you would need a little longer to come up with additional operators. Thus we implemented our own workaround with the customer site. We are fine with that. You can only implement that many feature request in a a certain amount of time :slight_smile:. And one can see that you are busy pouring out new features in C8.

So: fine for us!

1 Like