camunda-community-hub / camunda-tasklist-client-java

Java client for the Tasklist API of Camunda Platform 8
Apache License 2.0
26 stars 16 forks source link

Filter by nested process variables #78

Open aowss opened 4 months ago

aowss commented 4 months ago

Hi, is it possible to fetch a set of tasks based on a nested process variable? Let's assume that my process variables are as follows:

{
  "order" {
    "orderId": "4425d148-a2a6-4b78-b42f-43f983adc131"
  }
}

Can I do searchCriteria.addVariableFilter("order.orderId", "4425d148-a2a6-4b78-b42f-43f983adc131");? If not, how can I do that?

chDame commented 2 months ago

Hi @aowss,

Did you try new TaskSearch().addVariableFilter("order", Map.of("orderId", "4425d148-a2a6-4b78-b42f-43f983adc131"))?

bl4ckp4nther commented 1 month ago

@chDame what if order has more attributes, like quantity etc... Will new TaskSearch().addVariableFilter("order", Map.of("orderId", "4425d148-a2a6-4b78-b42f-43f983adc131")) still work?

chDame commented 1 month ago

Hi @bl4ckp4nther,

No it's not working, the backend API only allow to search on exact match. I tried to search on order.orderId instead but that's also not supported because the index is built on the whole variable.