Added completed work item dashlet and removed temporary one

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3521 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-08-15 15:51:50 +00:00
parent a3f3a6f2c6
commit 3f307a53e8
7 changed files with 123 additions and 27 deletions

View File

@@ -34,12 +34,19 @@ public class WorkflowBean
{
protected WorkflowService workflowService;
protected List<Node> workItems;
protected List<Node> completedWorkItems;
private static final Log logger = LogFactory.getLog(WorkflowBean.class);
// ------------------------------------------------------------------------------
// Bean Getters and Setters
/**
* Returns a list of nodes representing the to do work items the
* current user has.
*
* @return List of to do work items
*/
public List<Node> getWorkItemsToDo()
{
// get the current username
@@ -61,6 +68,33 @@ public class WorkflowBean
return this.workItems;
}
/**
* Returns a list of nodes representing the completed work items the
* current user has.
*
* @return List of completed work items
*/
public List<Node> getWorkItemsCompleted()
{
// get the current username
FacesContext fc = FacesContext.getCurrentInstance();
User user = Application.getCurrentUser(fc);
String userName = ISO9075.encode(user.getUserName());
// get the current in progress tasks for the current user
List<WorkflowTask> tasks = this.workflowService.getAssignedTasks(
userName, WorkflowTaskState.COMPLETED);
// create a list of transient nodes to represent
this.completedWorkItems = new ArrayList<Node>(tasks.size());
for (WorkflowTask task : tasks)
{
createWorkItem(task);
}
return this.completedWorkItems;
}
/**
* Sets the workflow service to use
*