Where are you storing the information that a task belongs to a particular state?
You can always use Hibernate to query any table in any manner for the jbpm tables.
There is of course the TaskQuery interface, but you can take a similar approach if you like that(maybe extend the interface? it's something I was starting to work on the other day. following the same approach as jbpm internally does),
or write up a DAO just for your Task Queries,