Hi there, I’m trying to search for instances that does not contain a certain boolean variable, this variable is always set to true when it exists. I tried doing this:
Hi William!
I actually wanna query the opposite: all instances that don’t have “fluxoRiscoFinalizado” set to True, including not having that variable. I couldn’t find a “variable not exists” as an option for the query, which would make sense here. Do you see an alternative maybe?
Obrigado!
Please try doing it as follows below and see if it works:
Since you are querying history, I suggest you add the query param firstResult and maxResult in your url.
POST https://localhost:8080/engine-rest/history/process-instance?maxResults=5&firstResult=1
I tried using both filters and the “eq null” by itself, it unfortunately doesn’t help… Seems like an engine limitation? I already found another indirect way to solve my real problem (instead of finding instances that didn’t set this variable, filter out instances that went through the task that sets the variable), but it would be great to have this feature somehow fixed
Hi @hassang
Unfortunately making myVar always present would be the “ugliest” choice for my use case. I managed to solve my issue with a task query instead of process instance query as mentioned earlier, which makes the variable obsolete.
Regardless it is important to be clear for other looking for this answer that you really cannot query process instances with a “variable NOT EXISTS” then.
Thanks everyone for the help!