-
1. Re: TaskQuery.processInstanceId bug?
mwohlf Sep 15, 2010 10:41 AM (in response to swd_eagle)there is a testcase for this: org.jbpm.test.task.TaskQueryProcessTest, so I tend to assume there is no bug, but of course you never know, can you provide a testcase?
-
2. Re: TaskQuery.processInstanceId bug?
swd_eagle Sep 15, 2010 4:14 PM (in response to mwohlf)This is the best I can do. Of any use?
String processInstanceId = (set somewhere) => Tomcat in debug mode shows it has value 7
TaskService taskService = processEngine.getTaskService();
Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).uniqueResult();
taskService.completeTask(task.getId());I get a NullPointerException, because task is null. Looking in the database, its procinst_ field is set to 7.
(I use the uniqueResult because there can only be one task at this stage for the process instance)
org.jbpm.test.task.TaskQueryProcessTest is not in my distribution of 4.4, btw. There are only 5 packages under org.jbpm.test, task is not one of them.
-
3. Re: TaskQuery.processInstanceId bug?
mwohlf Sep 16, 2010 5:46 AM (in response to swd_eagle)the full path is
/jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryProcessTest.java
it was added in Revision 5032 at June 12th 2009, so it should be in 4.4
-
4. Re: TaskQuery.processInstanceId bug?
jimmyb82 Sep 16, 2010 7:04 AM (in response to swd_eagle)If you set the following parameters in your jbpm.hibernate.cfg.xml
{code:xml}
<property name="hibernate.format_sql">true</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>
{code}
then you can see the query being generated by jBPM and work out why your task isn't being loaded by running it directly on the database.
I had a similar problem and it turned out that it was because my task had never been persisted.
(spring configuration mistake on my part).