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. |
4e58970 to
ae1bb77
Compare
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 theConditionalInputattribute to specify inputs that should only be shown for certain states.src/modules/Elsa.Workflows.Core/Attributes/Conditional/StateDropdownInput.cs: Added theStateDropdownInputattribute 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 newConditionalDescriptormodel to describe conditional inputs.src/modules/Elsa.Workflows.Core/Models/ConditionalDescriptor.cs: Added a similarConditionalDescriptormodel within the workflows core module.Integration with Existing Code:
src/modules/Elsa.Workflows.Core/Services/ActivityDescriber.cs: Updated theDescribeInputPropertyAsyncmethod to include logic for handling conditional and state dropdown inputs.src/modules/Elsa.Workflows.Core/Attributes/InputAttribute.cs: Added properties to theInputAttributeclass 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