Hi Jimmy,
Here is an issue for query by variable.
https://jira.jboss.org/browse/JBPM-2505
But because we could store serializable object into database, so it is hard to query these variables. So could you have some advices on it?
And I think we could support querying process instance by activity name. Please open an issue for this. Thank you very much.