The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VAF Asynchronous Operations Dashboard Question

Hello,

I don't have any issues making my task run and performing actions but I am wondering how I can hide the dashboard created(or not create the dashboard) if something like "Enabled" in my configuration is set to No:

See:

I have my TaskQueue and TaskProcessor:

I just don't want to show the dashboard if enabled = No. Not sure where to hide or perhaps not stop the creation based on that configuration attribute.

Thanks,

Mitch

  • Hide the entire dashboard, or just one queue/processor?

    To hide a single queue or processor you can use the [HideOnDashboard] attribute: VAF.Extensions.Community/MFiles.VAF.Extensions at master · M-Files/VAF.Extensions.Community (github.com)

    If you want to hide the entire section then the advice depends on the exact version of the extensions you're using.  If you are using the latest pre-release (or the release that's made later today) then you could override GetAsynchronousDashboardContent and return null: VAF.Extensions.Community/ConfigurableVaultApplicationBase.GetDashboardContent.cs at new-vaf-release · M-Files/VAF.Extensions.Community (github.com)

  • I do see how to hide the dashboard and that is fairly straightforward but what would be your advice in controlling when to hide the dashboard? For example, in the configuration I have a boolean "HideDashboard" and that controls if the dashboard is hidden or not, any input on how to control that? I assume I'd have to call either version(one hidden and one not) based on the boolean value but I am not sure how.

  • In addition to my reply previous, is it possible to clear the dashboard of all errors via code(or even via the admin?). I have not found a way to clear the dashboard. The problem is sometimes errors occur, and that is fine, but we don't want them to show in the dashboard. The dashboard itself is great but we want to throw the errors ourselves in a different manner not visible to the users.

    Thanks,

    Mitch

  • The Extensions library is designed to allow you to - at design-time - control which task queues or task processors are hidden.  That is done via the [HideOnDashboard] attribute.  The Extensions library is not designed to allow the decision for which task processors are shown or hidden to be controlled via configuration or other runtime value.

    If you wanted to do this then you'd need to look at how the GetAsynchronousOperationDashboardContent method works (VAF.Extensions.Community/ConfigurableVaultApplicationBase.GetDashboardContent.cs at 0fa2bda15e60b25dfb4b7658a95c9f3a484ff15e · M-Files/VAF.Extensions.Community (github.com)) and add that functionality yourself; I assume by checking the list items that are returned by the various calls in that method and working out whether or not to add them to the list.

  • Do you mean that you want to remove tasks that have been marked as errored from the queue?  If so then there is no direct method to do so (even natively via the API).  The server will clear the queue down periodically.

    I guess you have a few options:

    • When you process the task do not allow it to be marked as failed; trap all exceptions, log them, then allow the task to be marked as completed.
    • When you process the task, trap exceptions and carefully choose what the re-queue or re-try behaviour should be (so that any transient errors - assuming that's what they are - are not shown as failures).
    • Override the Extensions library functionality to hide failed tasks (I don't recommend this).
    • Override the Extensions library and build your own table for the task content instead, hiding and showing content as you need (I don't recommend this).

    I personally don't really understand the concept of "The problem is sometimes errors occur, and that is fine, but we don't want them to show in the dashboard": for me the dashboard is a place where administrators can see the status of the application; if there are errors then there are errors.  If the errors are transient then use the requeue functionality to stop them being dealt with as full errors.