private List<WorkflowTask> assertUserHasTasks(final String username, final int number) { List<WorkflowTask> tasks = WORKFLOW_SERVICE.getAssignedTasks(username, WorkflowTaskState.IN_PROGRESS); // Need mutable collection. List<WorkflowTask> allTasks = new ArrayList<WorkflowTask>(); allTasks.addAll(tasks); allTasks.addAll(WORKFLOW_SERVICE.getPooledTasks(username)); assertEquals("Wrong number of tasks assigned to user", number, allTasks.size()); return tasks; } }
/** * Return a list of objects representing the completed tasks for the current user * * @return list of WorkflowTaskItem bean objects {@link WorkflowTaskItem} */ public List<WorkflowTaskItem> getCompletedTasks() { // get the "completed" tasks for the current user List<WorkflowTask> tasks = getWorkflowService().getAssignedTasks( this.services.getAuthenticationService().getCurrentUserName(), WorkflowTaskState.COMPLETED); return convertTasks(tasks); }
/** * Return a list of objects representing the assigned tasks for the current user * * @return list of WorkflowTaskItem bean objects {@link WorkflowTaskItem} */ public List<WorkflowTaskItem> getAssignedTasks() { // get the "in progress" tasks for the current user List<WorkflowTask> tasks = getWorkflowService().getAssignedTasks( this.services.getAuthenticationService().getCurrentUserName(), WorkflowTaskState.IN_PROGRESS); return convertTasks(tasks); }
/** * Return a list of objects representing the completed tasks for the current user * * @return list of WorkflowTaskItem bean objects {@link WorkflowTaskItem} */ public List<WorkflowTaskItem> getCompletedTasks() { // get the "completed" tasks for the current user List<WorkflowTask> tasks = getWorkflowService().getAssignedTasks( this.services.getAuthenticationService().getCurrentUserName(), WorkflowTaskState.COMPLETED); return convertTasks(tasks); }
/** * Return a list of objects representing the assigned tasks for the current user * * @return list of WorkflowTaskItem bean objects {@link WorkflowTaskItem} */ public List<WorkflowTaskItem> getAssignedTasks() { // get the "in progress" tasks for the current user List<WorkflowTask> tasks = getWorkflowService().getAssignedTasks( this.services.getAuthenticationService().getCurrentUserName(), WorkflowTaskState.IN_PROGRESS); return convertTasks(tasks); }
/** * Get tasks assigned to the current user, filtered by workflow task state. * Only tasks having the specified state will be returned. * * @param state workflow task state to filter assigned tasks by * @return the list of assigned tasks, filtered by state */ private Scriptable getAssignedTasksByState(WorkflowTaskState state) { WorkflowService workflowService = services.getWorkflowService(); String currentUser = services.getAuthenticationService().getCurrentUserName(); List<WorkflowTask> cmrAssignedTasks = workflowService.getAssignedTasks(currentUser, state); ArrayList<Serializable> assignedTasks = new ArrayList<Serializable>(); for (WorkflowTask cmrTask : cmrAssignedTasks) { assignedTasks.add(new JscriptWorkflowTask(cmrTask, services, getScope())); } return (Scriptable)new ValueConverter().convertValueForScript(services, getScope(), null, assignedTasks); } }
/** * Get tasks assigned to the current user, filtered by workflow task state. * Only tasks having the specified state will be returned. * * @param state workflow task state to filter assigned tasks by * @return the list of assigned tasks, filtered by state */ private Scriptable getAssignedTasksByState(WorkflowTaskState state) { WorkflowService workflowService = services.getWorkflowService(); String currentUser = services.getAuthenticationService().getCurrentUserName(); List<WorkflowTask> cmrAssignedTasks = workflowService.getAssignedTasks(currentUser, state); ArrayList<Serializable> assignedTasks = new ArrayList<Serializable>(); for (WorkflowTask cmrTask : cmrAssignedTasks) { assignedTasks.add(new JscriptWorkflowTask(cmrTask, services, getScope())); } return (Scriptable)new ValueConverter().convertValueForScript(services, getScope(), null, assignedTasks); } }
@Test public void testAddExistingUser() throws Exception { this.invitationServiceImpl.setNominatedInvitationWorkflowId( WorkflowModelNominatedInvitation.WORKFLOW_DEFINITION_NAME_ACTIVITI_ADD_DIRECT); testNominatedInvitationExistingUser(false); List<WorkflowTask> initiatorTasks = this.workflowService.getAssignedTasks(USER_MANAGER, WorkflowTaskState.IN_PROGRESS); assertEquals(0, initiatorTasks.size()); } }
List<WorkflowTask> tasks = workflowService.getAssignedTasks(AuthenticationUtil.getRunAsUser(), WorkflowTaskState.IN_PROGRESS); for (WorkflowTask task : tasks) List<WorkflowTask> tasks = workflowService.getAssignedTasks(AuthenticationUtil.getRunAsUser(), WorkflowTaskState.COMPLETED); for (WorkflowTask task : tasks)
List<WorkflowTask> tasks = workflowService.getAssignedTasks(AuthenticationUtil.getRunAsUser(), WorkflowTaskState.IN_PROGRESS); for (WorkflowTask task : tasks) List<WorkflowTask> tasks = workflowService.getAssignedTasks(AuthenticationUtil.getRunAsUser(), WorkflowTaskState.COMPLETED); for (WorkflowTask task : tasks)
List<WorkflowTask> tasks = workflowService.getAssignedTasks(USER2, WorkflowTaskState.IN_PROGRESS); assertEquals(1, tasks.size()); tasks = workflowService.getAssignedTasks(USER3, WorkflowTaskState.IN_PROGRESS); assertEquals(1, tasks.size());
List<WorkflowTask> tasks = workflowService.getAssignedTasks(USER2, WorkflowTaskState.IN_PROGRESS); assertEquals(1, tasks.size());
List<WorkflowTask> tasks = workflowService.getAssignedTasks(USER_ONE, WorkflowTaskState.IN_PROGRESS); int tasksBefore = tasks.size(); tasks = workflowService.getAssignedTasks(USER_ONE, WorkflowTaskState.IN_PROGRESS); int tasksAfter = tasks.size(); assertTrue("Expecting there to be more tasks", tasksAfter > tasksBefore);