-
1. Re: Historytask query
rebody Jun 3, 2010 2:24 AM (in response to zhiyongcui)Hi zhiyong,
You could use plain hibernate api to query historytask. Just like this:
session.createQuery("from org.jbpm.pvm.internal.history.model.HistoryTaskImpl").list()
-
2. Re: Historytask query
zhiyongcui Jun 3, 2010 3:35 AM (in response to rebody)How to get session in jbpm4.1? Or how to use plain hql query in jbpm4?
-
3. Re: Historytask query
swiderski.maciej Jun 3, 2010 4:29 AM (in response to zhiyongcui)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.
EnvironmentImpl.getFromCurrent().get(Session.class)
HTH
-
4. Re: Historytask query
zhiyongcui Jun 3, 2010 5:02 AM (in response to swiderski.maciej)Thanks for you reply. But
1. what I want to do is filter the result based on the process definition.
2.
EnvironmentImpl.getFromCurrent().get(Session.class) seems could not get a hibernate session.
-
5. Re: Historytask query
rebody Jun 3, 2010 5:20 AM (in response to zhiyongcui)Hi zhiyong,
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:
EnvironmentImpl.getFromCurrent(Session.class);
before using this, please make sure you have already open an Environment.
-
6. Re: Historytask query
zhiyongcui Jun 3, 2010 5:27 AM (in response to rebody)Would you be pleased to give me a complete source code for open a hibernate session? I am a new user of jbpm4.