You could use plain hibernate api to query historytask. Just like this:
How to get session in jbpm4.1? Or how to use plain hql query in jbpm4?
You can use HistoryTaskQuery with assignee as a condition.
historyService.createHistoryTaskQuery().assignee("your user name").list();
Next you can filter that based on execution id.
If you want to use HQL you can either use hql activity in you process to fetch that information and set them as variable or write custom Command where you will be able to get hibernate session from environment.
Thanks for you reply. But
1. what I want to do is filter the result based on the process definition.
EnvironmentImpl.getFromCurrent().get(Session.class) seems could not get a hibernate session.
search by process definition infor is more complicated. Please there is no table for process definition, and the id, key, name, version column was stored in the deploy_prop table. I am afraid you have to use lots of 'join' to achieve this.
And if you want to get Session, please use this:
before using this, please make sure you have already open an Environment.
Would you be pleased to give me a complete source code for open a hibernate session? I am a new user of jbpm4.