Query process instances with object

Is it possible to query the process instances by a specific (custom) object?

I try to do that with my simplified object:

public class myTestData {
private String id;

public static String getId() {
    return id;
}

public void setId(String id) {
    this.id = id;
}

}

When I then try to run:

camunda.getRuntimeService().createProcessInstanceQuery()
            .variableValueEquals(myTestData.getId(), "1234")
            .list();

My response is always empty.

Here it’s look like they do the same thing:
Can you do it?

If I store the variable to a String variable as “myNewID” it’s work like a charm, but I would like to query my object.

camunda.getRuntimeService().createProcessInstanceQuery()
                .variableValueEquals("myNewID", "1234")
                .list()

Hi @Hula,

Object variable values are stored in a blob column in the database. The database didn’t offer to search for values here.

If you need to, you can add a search-variable as a String and take care of the size: Camunda Best Practices - Enhancing Tasklists with Business Data

Hope this helps, Ingo