REST-API: filtering process instances by variables and operator does not work properly

Hi,
I have a problem with getting a process instances list via REST-API using a varable filter and the “neqoperator.

I want to get a list of all process instances which don’t have a special variable set, so I use the “neq” operator, but this doesn’t seem to work as expected if a variable is not set.

The problem is, that instances which don’t have the variable set are not returned either.

Example:

https://ourserver:9443/processcontrol-engine/camunda/rest/process-instance?variables=tenantId_eq_XYZ,SPECIALVAR_neq_ABC

RESULT: 0

https://ourserver:9443/processcontrol-engine/camunda/rest/process-instance?variables=tenantId_eq_XYZ

Result: 1 process instance which DOES NOT have SPECIALVAR set at all.

So in the first place, the result should include this instance, too, but it doesn’t.

Is this a bug?

I think this is working as designed. The problem is that the variable SPECIALVAR doesn’t exist, so it’s not getting tested. If you were to set SPECIALVAR to even have a null value in that instance, your neq query would work.