public async Task <IEnumerable <WorkflowVariableViewModel> > GetVariablesAsync(int id) { var list = await this.repository.ListAsync(new WorkflowVariablesForWorkflow(id)); var workflow = list.FirstOrDefault(); if (workflow == null) { throw new KeyNotFoundException(nameof(id)); } var viewModels = workflow.WorkflowVariables.OrderBy(v => v.Type); return(ViewModelMapper.ToWorkflowVariableViewModelList(viewModels)); }
public async Task <IEnumerable <WorkflowHistoryViewModel> > GetHistoryAsync(int id) { var list = await this.repository.ListAsync(new WorkflowHistoryForWorkflow(id)); var workflow = list.FirstOrDefault(); if (workflow == null) { throw new KeyNotFoundException(nameof(id)); } var viewModels = workflow.WorkflowHistories.OrderByDescending(h => h.Created); return(ViewModelMapper.ToWorkflowHistoryViewModelList(viewModels)); }
public async Task <PaginatedList <WorkItemViewModel> > GetFailedAsync( PagingParameters pagingParameters ) { var count = await this.repository .CountAsync(new WorkItemRetryLimitHitCount(WorkItem.WORKITEM_RETRIES)); var items = await this.repository .ListAsync(new WorkItemRetryLimitHitCountOrderedPaginated( WorkItem.WORKITEM_RETRIES, pagingParameters.SkipCount, pagingParameters.PageSize )); return(new PaginatedList <WorkItemViewModel>( ViewModelMapper.ToWorkItemViewModelList(items), count, pagingParameters.PageIndex, pagingParameters.PageSize )); }
public async Task <PaginatedList <WorkItemViewModel> > GetUpCommingsAsync( PagingParameters pagingParameters ) { var now = SystemTime.Now(); var count = await this.repository .CountAsync(new WorkItemDueDateGreaterThanNowCount(now)); var items = await this.repository .ListAsync(new WorkItemDueDateGreaterThanNowOrderedPaginated( now, pagingParameters.SkipCount, pagingParameters.PageSize )); return(new PaginatedList <WorkItemViewModel>( ViewModelMapper.ToWorkItemViewModelList(items), count, pagingParameters.PageIndex, pagingParameters.PageSize )); }
public IEnumerable <WorkItemViewModel> GetSnapshot() { return(ViewModelMapper.ToWorkItemViewModelList(this.Items.ToArray())); }