private TaskModel GetTasks(string workflowOid) { var task = new TaskModel(); var tasks = TasksService.GetNextTasksForWorkflow(new GetNextTasksForWorkflowRequest { WorkflowOid = Guid.Parse(workflowOid) }); List <TaskItem> items = new List <TaskItem>(); foreach (var t in tasks.Tasks) { items.Add(new TaskItem { Code = t.TaskCode, Title = t.Title, Description = t.Description, AcceptedBy = string.IsNullOrWhiteSpace(t.AcceptedBy) ? string.Empty : t.AcceptedBy, TaskId = t.TaskOid.ToString() }); } task.Tasks = items; return(task); }
public IEnumerable <TaskApiModel> GetTasksForWorkflow(string woid) { Guid oid; if (string.IsNullOrWhiteSpace(woid) || !Guid.TryParse(woid, out oid)) { throw new HttpResponseException(HttpStatusCode.BadRequest); } return(TasksService.GetNextTasksForWorkflow(new GetNextTasksForWorkflowRequest { WorkflowOid = oid }).Tasks .Select(t => TheModelFactory.Create(t, GetAttachedDocuments(t.TaskOid)))); }