Not sure what you mean but I’m using the original example you provided, to understand how to match against local variables in a query.
The correlation example you provided, is similar to what I need, but I only need to get back the process executions. I don’t want to correlate. The input did the trick, thanks.
Thus my question is, you have say four instances within the multiple-instance task ( e.g. “dog”,“cat”,“horse”,“cat”), how do I match against the local variable, say ‘cat’ and return only the matched instance(s).
So for example, How to find a multiInstanceBody Task with a specific variable value
The following returns a list of instances.
List<Execution> list = runtimeService
.createExecutionQuery()
.messageEventSubscriptionName("MyCustomMessage")
.processVariableValueEquals("customMatchVariable", "cat")
.list();