-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional inputs #6410
base: main
Are you sure you want to change the base?
Conditional inputs #6410
Conversation
Remove unused properties Add docstrings
@dotnet-policy-service agree company="Mitutoyo CTL Germany GmbH" |
I'm not sure if your use case is similar to the one we had or not... Our use case is that we have a RunScript task that offers a list of separately controlled scripts that can be selected to be run. Each script has a a different set of parameters which could be configured. The solution we came up with was to support maps of script parameter and Input. So for one script you could have a "param1" parameter that is an Your case could be completely different, and if it is, please just ignore this comment. |
Thanks for your comment @bobhauser. |
This pull request introduces new functionality to support conditional inputs in the Elsa workflows. The changes include adding new attributes and models to handle conditional inputs and state dropdowns, and updating existing descriptors to incorporate these new features.
This PR is a refined version of PR #5343 for the issue
.
The corresponding PR in elsa-studio is
New Attributes and Models:
src/modules/Elsa.Workflows.Core/Attributes/Conditional/ConditionalInputAttribute.cs
: Introduced theConditionalInput
attribute to specify inputs that should only be shown for certain states.src/modules/Elsa.Workflows.Core/Attributes/Conditional/StateDropdownInput.cs
: Added theStateDropdownInput
attribute to specify dropdown inputs with state options.src/modules/Elsa.Workflows.Core/Attributes/Conditional/ConditionalInputOptions.cs
: Defined constants for different conditional input options.Updated Descriptors:
src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ConditionalDescriptor.cs
: Created a newConditionalDescriptor
model to describe conditional inputs.src/modules/Elsa.Workflows.Core/Models/ConditionalDescriptor.cs
: Added a similarConditionalDescriptor
model within the workflows core module.Integration with Existing Code:
src/modules/Elsa.Workflows.Core/Services/ActivityDescriber.cs
: Updated theDescribeInputPropertyAsync
method to include logic for handling conditional and state dropdown inputs.src/modules/Elsa.Workflows.Core/Attributes/InputAttribute.cs
: Added properties to theInputAttribute
class to support conditional inputs and state dropdowns.These changes enhance the Elsa workflows by allowing more dynamic and state-dependent input configurations.
A example usage of the conditional inputs could look like this:
This change is