What are you trying to do exactly? building a new user interface for workflow management? If yes, I'd recommend you review the OOTB workflow console, JMX Console or ACS Commons Bulk Workflow Manager to assess if they fulfill your requirements. If you need a query for adhoc analysis, you can use som...