Shannon Sumner [
http://community.jboss.org/people/shannonsumner] created the discussion
"Re: Find Tasks by Candidate-Group Name"
To view the discussion, visit:
http://community.jboss.org/message/565625#565625
--------------------------------------------------------------
Thanks Michael - this is what I came up with ...
/**
* Gets the unassigned tasks by group.
*
* @param strGroupId
* the str group id
* @return the unassigned tasks by group
*/
private List<Task> getUnassignedTasksByGroup(final String strGroupId)
{
final ParamCommand<List<Task>> paramCommand = new
ParamCommand<List<Task>>()
{
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
public final List<Task> execute(final Environment environment)
{
DbSessionImpl dbSessionImpl = environment
.get(DbSessionImpl.class);
Session session = dbSessionImpl.getSession();
return session
.createQuery(
" select participation.task from "
+ ParticipationImpl.class
.getName()
+ " participation "
+ " join participation.task as task "
+ " where participation.groupId =
:groupId"
+ " and task.assignee is null ")
.setParameter("groupId",
params.get("strGroupId"))
.list();
}
};
return processEngine.execute(paramCommand.setParam("strGroupId",
strGroupId));
}
/**
* Gets the workgroup tasks by group.
*
* @param strGroupId
* the str group id
* @return the workgroup tasks by group
*/
private List<Task> getWorkgroupTasksByGroup(final String strGroupId)
{
final ParamCommand<List<Task>> paramCommand = new
ParamCommand<List<Task>>()
{
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
public final List<Task> execute(final Environment environment)
{
DbSessionImpl dbSessionImpl = environment
.get(DbSessionImpl.class);
Session session = dbSessionImpl.getSession();
return session
.createQuery(
" select participation.task from "
+ ParticipationImpl.class
.getName()
+ " participation "
+ " join participation.task as task "
+ " where participation.groupId =
:groupId"
+ " and task.assignee is not null ")
.setParameter("groupId",
params.get("strGroupId"))
.list();
}
};
return processEngine.execute(paramCommand.setParam("strGroupId",
strGroupId));
}
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/565625#565625]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]