-
1. Re: (User Tasks) How to get user tasks by process instance?
salaboy21 Aug 13, 2011 12:28 PM (in response to a.d.jbpm)you usually build your task lists oriented interfaces using the user that is logged to retrieve his/her tasks. Why do you want to query the task generated by a process instance?
Can you elaborate on your business case?
-
2. Re: (User Tasks) How to get user tasks by process instance?
a.d.jbpm Aug 14, 2011 8:49 AM (in response to salaboy21)I have several executing instances of a process X (for instance, 4 executing instances).
When I invoke 'taskClient.getTasksAssignedAsPotentialOwner("john",...)', I get assigned tasks for 'john' in all different running instances. However, I am interesting to retrieve only john's tasks in instance id=3.
-
3. Re: (User Tasks) How to get user tasks by process instance?
salaboy21 Aug 14, 2011 4:14 PM (in response to a.d.jbpm)I know, that's the idea, but if you create a task list john will see all his tasks and he will be able to choose in which task to work. If you want to know from the history logs which process create each task you have the Task.TaskData.workItemId reference that helps you to find the process where that task instance was created. Notice that there is a named query defined for that reason:
<named-query name="TaskByWorkItemId">
<query>
select
t
from
Task t
where
t.taskData.workItemId = :workItemId
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
Cheers