This content has been marked as final.
Show 3 replies
-
1. Re: How to retrieve the Task list of a user ?
kukeltje Jan 17, 2008 11:35 AM (in response to francis1970)actor class is not needed. Please make a unit test that demonstrates the problem....
-
2. Re: How to retrieve the Task list of a user ?
dleerob Jan 18, 2008 8:32 AM (in response to francis1970)In your process definition, you have:
<swimlane name="user"> </swimlane>
You've defined a swimlane called "user", but you haven't assigned any users to that swimlane.
Also, to get a list of tasks that can potentially be assigned to a user, I use a method like this:/** * Gets all task instances that a user with the given actor id could claim. * @return List of jbpm task instances. */ public static List getUnClaimedTaskInstancesForActorId (JbpmContext jbpmContext, String actorId) { Session session = jbpmContext.getSession(); //create list of possible id's (this includes groups) that //belong to the current user. List actorsList = new ArrayList(); actorsList.add(actorId); IdentitySession identitySession = new IdentitySession(session); org.jbpm.identity.User jbpmUser = identitySession.getUserByName(actorId); Iterator i = jbpmUser.getMemberships().iterator(); while(i.hasNext()){ Membership m = (Membership) i.next(); actorsList.add(m.getGroup().getName()); } List pooledTaskInstances = jbpmContext.getTaskMgmtSession().findPooledTaskInstances(actorsList); List jbpmTaskInstanceList = session.createQuery("from org.jbpm.taskmgmt.exe.TaskInstance ti where ti.start is null and ti.end is null and actorId = '"+actorId+"'").list(); //add pooledTaskInstances to taskList jbpmTaskInstanceList.addAll(pooledTaskInstances); //TODO sort jbpmTaskInstanceList by task instance id return jbpmTaskInstanceList; }
Hope this helps a bit. Good luck! -
3. Re: How to retrieve the Task list of a user ?
francis1970 Jan 18, 2008 9:07 AM (in response to francis1970)Thanks for your kind replies.
At the moment I have solved the problem using an assignment handler which fires when the Task node is entered.
Thanks for your hints.