-
1. Re: ActorId & PooledActors
swatis Apr 14, 2009 12:37 AM (in response to ardavan)You can set pooled actors as well actor also.
You can do the following
assignable.setPooledActors(new String[]{"userA", "userB"});
assignable.setActorId("userC"); -
2. Re: ActorId & PooledActors
ardavan Apr 14, 2009 9:56 AM (in response to ardavan)Thanks for your answer Swatis.
I am traveling around and don't have access to jBPM code for now on.
My issue is:
First by implementing the AssignmentHandlerInterface and using:
assignable.setPooledActors(new String[] { groupNameId });
I assign a taskinstance to a group of people.
When a userA wants to "end" the taskInstance, the code is:
taskInstance.setActorId("userA");
taskInstance.end();
After when I run a simple query looking for taskInstances that are ended and have pooledActors equal to groupNamedId, I have no results;
as if my taskInstance.getPooledActors was equal to null.
Is it comprehensible? -
3. Re: ActorId & PooledActors
swatis Apr 15, 2009 7:43 AM (in response to ardavan)Collection l_objClTskInstances = executionContext.getTaskMgmtInstance(
).getTaskInstances();
Iterator it = l_objClTskInstances.iterator();
while(it.hasNext()) {
TaskInstance l_objTskInstance = (TaskInstance) it.next();
if(l_objTskInstance.hasEnded()) {
Iterator antIt = l_objTskInstance.getPooledActors().iterator();
while(antIt.hasNext()) {
PooledActor l_objPooledActor = (PooledActor) antIt.next();
System.out.println("hello pooled task instance actors are " +
l_objPooledActor.getActorId());
}
}
} -
4. Re: ActorId & PooledActors
ardavan Apr 16, 2009 10:57 AM (in response to ardavan)Thank you my friend.
There was an issue in my query. Now I am using this query and get the right information.public List findEndedPooledTaskInstancesByName(List actorIds) { JbpmContext jbpmContext = Tools.jbpmConfiguration.createJbpmContext(); try { List taskList; Query query = getSession(jbpmContext).createQuery("select distinct ti\n" + " from org.jbpm.taskmgmt.exe.PooledActor pooledActor "+ " join pooledActor.taskInstances ti " + " where pooledActor.actorId in ( :actorIds ) " + " and ti.actorId != null " + " and ti.end != null"); query.setParameterList("actorIds", actorIds); taskList = query.list(); return taskList; } finally { jbpmContext.close(); } }