Hi @c.keimel,
Thank you for creating the test case. In fact, this is the expected behavior and that is what I tried to describe in my last post regarding query three. processVariableValueEquals
matches a task, if there is a matching variable that has the same process instance id as the task. In consequence, the filter matches even if the variable is not accessible from the task that is returned by it.
I think the reason why this API behaves this way is that it is not a trivial task to decide in a SQL query whether a variable is visible from a task (or execution) due to the dynamic tree structure of variable scopes. For example, a task can be define in a sub process, that is defined in another subprocess, and that is defined in the root process. All of these scopes may hold variables that are visible to the task and a proper implementation would have to consider this.
Cheers,
Thorben