elsa-workflows / elsa-workflows/elsa-core
Feature: Dynamic input configuration and validation v3
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
To make Inputs with dropdown values currently it is possible to set constant values with the `Options` property inside the `Input` attribute or use the `OptionsProvider` property to use a class grabbing the possible options.
What I found out is that this will be called only once after startup to generate some kind of metadata of all activities.
This mechanism has 2 disadvantages:
1. If the list of items returned by an `IActivityPropertyOptionsProvider` class will change after some time you have to restart the whole application
2. It is not possible to make options dependent on other inputs which makes it difficult to create a good user experience
Example:
We have some kind of production lines and our custom activity needs a sensor to be selected.
According to point 1 it is not possible to select new sensors added after the software started even if the software now knows the sensors because the list of available sensors will not be updated anymore.
According to point 2 it is possible that there is a very hugh number of sensors and therefore it is impossilbe to find the right one.
To avoid this I would add some more dropdown inputs.
1. The first input was the production line itself
2. The second input was a station depending on the production line
3. The third input is the sensor depending on the station
Now the list of available stations is much shorter and the user is able to find the right on.
Nice to have features:
1. Call the `GetOptions` from the `IActivityPropertyOptionsProvider` everytime I click on the dropdown input
2. Pass the current activity instance to it to be able to filter options by other inputs of the activity
3. Add input dependencies to disable the inputs until the dependencies have a valid value
Contributor guide
Assessment
This issue has not been assessed yet.