/// <summary> /// Get Next Tasks For User /// </summary> /// <param name="request">Request</param> /// <returns>GetNextTasksForUserResponse</returns> public GetNextTasksForUserResponse GetNextTasksForUser(GetNextTasksForUserRequest request) { var response = new GetNextTasksForUserResponse(); response.Tasks = _task.GetNextTasksForUser(request.User, request.WorkflowOid, request.Domain, request.PageIndex, request.PageSize, request.SearchFor).ToArray(); return(response); }
private static GetNextTasksForUserResponse GetTasks(string workflowId) { var getNextTasksForUserRequest = new GetNextTasksForUserRequest { User = "******", WorkflowOid = Guid.Parse(workflowId) }; GetNextTasksForUserResponse tasks = null; using (var src = new FlowTasksService("FlowTasksService_Endpoint")) { tasks = src.GetNextTasksForUser(getNextTasksForUserRequest); } return(tasks); }
/* GetTasksList * TODO: To improve performance we should get the tasks to display * from ther server without getting all the records all the time. */ /// <summary> /// Get Tasks List /// </summary> /// <param name="filterModel">FilterModel</param> /// <returns>TaskListModel</returns> private TaskListModel GetTasksList(FilterModel filterModel) { var getNextTasksForUserRequest = new GetNextTasksForUserRequest { User = HttpContext.User.Identity.Name, WorkflowOid = Guid.Empty, Domain = filterModel.Domain == Domains.All ? string.Empty : filterModel.Domain, }; GetNextTasksForUserResponse tasks = TasksService.GetNextTasksForUser(getNextTasksForUserRequest); var filter = new TaskFilter(filterModel); var trimedTasks = filter.RunSearch(tasks.Tasks); var taskList = CreateTaskList(filter, trimedTasks); return(new TaskListModel { Tasks = taskList }); }
private TaskListController ArrangeTestForNavigation() { var userMock = new Mock <IFlowUsersService>(); var taskMock = new Mock <IFlowTasksService>(); var docMock = new Mock <IFlowDocsDocument>(); var respTasks = new GetNextTasksForUserResponse(); respTasks.Tasks = CreateTestTasks(10); var respProps = new GetPropertiesForTaskResponse(); respProps.Properties = CreateTestProperties(1); var respCmt = new GetTraceForWorkflowResponse(); respCmt.Traces = null; var respDomains = new GetDomainsForUserResponse(); respDomains.Domains = new[] { "google" }; taskMock.Setup(t => t.GetNextTasksForUser(Moq.It.IsAny <GetNextTasksForUserRequest>())) .Returns(respTasks); taskMock.Setup(t => t.GetTraceForWorkflow(Moq.It.IsAny <GetTraceForWorkflowRequest>())) .Returns(respCmt); taskMock.Setup(t => t.GetPropertiesForTask(Moq.It.IsAny <GetPropertiesForTaskRequest>())) .Returns(respProps); userMock.Setup(u => u.GetDomainsForUser(Moq.It.IsAny <GetDomainsForUserRequest>())) .Returns(respDomains); var sut = new TaskListController(userMock.Object, taskMock.Object, docMock.Object); sut.ControllerContext = MockUtil.GetMockedControllerContext(); return(sut); }