elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.39k stars 1.18k forks source link

[ENH] - Allow assigning categories to Workflow Definitions so they can be easily searched/filtered #5872

Open zer0bugz opened 2 months ago

zer0bugz commented 2 months ago

Enhancement Request

Enhancement Overview

The current WorkflowDefinitions screen from Elsa Studio lacks the possibility of filtering/searching workflow definitions based on custom properties, which makes it difficult to use when there are a large number of workflow definitions present.

Proposed Enhancement

What I would like is to have some way to assign certain workflow definitions one-or-more categories, so that, in situations where there are 100+ definitions present, I would have a simple way to filter the list by these categories. I noticed that in the actual WorkflowDefinition entity there is a CustomProperties, for which the summaries Can be used to store application-specific properties to associate with the workflow. So maybe this would be suitable to store such information.

Then could we have it exposed via Elsa.Api.Client.Resources.WorkflowDefinitions.Models.WorkflowDefinitionSummary so this way the value would become available when calling via Elsa.Api.Client.Resources.WorkflowDefinitions.Contracts.IWorkflowDefinitionsApi.ListAsync? Then in the Studio, the WorkflowDefinitionList template could get another MudSelect that would allow filtering based on data contained in the CustomProperties. But afaik, the CustomProperties cannot be managed from the Studio interface - so if the above stands, then the WorkflowDefinition editor would also need an update.

Alternative Solutions

I guess that just adding a category property on the WorkflowDefinition would also work - though a propertybag-like container (such as CustomProperties) will allow for greater flexibility in the future.

Use Cases / Impact of Enhancement

This would be mainly useful for orgs that use the Elsa platform in scenarios with a large number of definitions. Once there are more than 20-30 workflows, it becomes harder to find the ones you are looking for. Furthermore, the WorkflowInstances overview could also benefit from this, as it would be possible to instantly see all instances for a given group/category of workflow definitions.

Visuals and Mockups

image

As a final note: if this makes sense, I could have a try at writing up the PR for it myself 🤷‍♂️

sNakiex commented 2 months ago

I believe there is already functionality like this, it's the Elsa.Labels module. afaik it's not implemented in the studio yet.

zer0bugz commented 2 months ago

yep, that looks exactly like what I was blabbering about 😊 thank you for pointing it out!

zer0bugz commented 2 months ago

all-right, I see a demo of how it works here: https://github.com/elsa-workflows/elsa-core/pull/3060 but how do I get this running? 🙂

sNakiex commented 2 months ago

all-right, I see a demo of how it works here: #3060 but how do I get this running? 🙂

The functionality still needs to be added to the blazor implementation of the studio.

indikau commented 1 day ago

Does anyone know if this implementation for studio exists in even a private branch?