diff --git a/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/DashboardQueueAndTaskDetails.cs b/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/DashboardQueueAndTaskDetails.cs index 9799f629..f5970855 100644 --- a/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/DashboardQueueAndTaskDetails.cs +++ b/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/DashboardQueueAndTaskDetails.cs @@ -44,5 +44,10 @@ public class DashboardQueueAndTaskDetails /// If this is a recurring process then details on the recurring frequency. /// public IRecurrenceConfiguration RecurrenceConfiguration { get; set; } + + /// + /// Determines the order the operations are shown on the dashboard. + /// + public int Order { get; set; } } } diff --git a/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/TaskManagerExAsynchronousDashboardContentProvider.cs b/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/TaskManagerExAsynchronousDashboardContentProvider.cs index c40961fb..18da79d9 100644 --- a/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/TaskManagerExAsynchronousDashboardContentProvider.cs +++ b/MFiles.VAF.Extensions/Dashboards/AsynchronousDashboardContent/TaskManagerExAsynchronousDashboardContentProvider.cs @@ -63,8 +63,12 @@ RecurringOperationConfigurationManager recurringOperationConfigu /// public IEnumerable>>> GetAsynchronousDashboardContent() { + + var items = new List>>>(); + if (null == TaskQueueResolver) - yield break; + return items; + foreach (var queue in TaskQueueResolver.GetQueues()) { @@ -184,7 +188,7 @@ public IEnumerable>> + items.Add(new KeyValuePair>> ( new DashboardQueueAndTaskDetails() { @@ -194,16 +198,19 @@ public IEnumerable(queue, processor.Type, MFTaskState.MFTaskStateInProgress) : TaskManager.GetAllExecutions(queue, processor.Type) - ); + )); } } + + return items.OrderBy(i => i.Key.Order); } } } diff --git a/MFiles.VAF.Extensions/Dashboards/TaskQueues/ShowOnDashboardAttribute.cs b/MFiles.VAF.Extensions/Dashboards/TaskQueues/ShowOnDashboardAttribute.cs index 5492fe01..76cc3424 100644 --- a/MFiles.VAF.Extensions/Dashboards/TaskQueues/ShowOnDashboardAttribute.cs +++ b/MFiles.VAF.Extensions/Dashboards/TaskQueues/ShowOnDashboardAttribute.cs @@ -97,6 +97,11 @@ public class ShowOnDashboardAttribute /// public string RunCommandDisplayText { get; set; } = ShowOnDashboardAttribute.DefaultRunCommandDisplayText; + /// + /// Used to determine the order in which the task processors are shown on the dashboard + /// + public int Order { get; set; } = 100; + public ShowOnDashboardAttribute(string name) { this.Name = name;