elsa-workflows / elsa-workflows/elsa-studio

Missing input validation in Elsa Workflow Editor for inherited CodeActivity<T> classes.

Open
#306 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
301
Forks
181
Avg merge
17h 12m
Merged PRs (30d)
42

Description

When I define a new activity like the example below, all fields rendered by the Elsa workflow editor are always of type string.

```[Activity("ProjectNamespace", "ProjectCategory", "ProjectDescription", DisplayName = "Project Name")]
public class CustomActivity : CodeActivity
{
[Input(Description = "Field description")]
[Range(0, int.MaxValue)]
public Input Order { get; set; } = default!;

[Input(Description = "Field description")]
public Input CustomString { get; set; } = default!;
}
```
When the above class is used in Elsa Wokflow editor, **both the fields are displayed of type 'string'**.

I believe Elsa Editor knows the data types of each field it is rendering but somehow it does not use that information to create numeric fields for numeric data types (input validation). Without this feature, users can enter any alphabetic or alphanumeric string for integer or other numeric fields while creating/editing a workflow definition. Further, I do not see any hook or annotation or any way to add custom input validation rules to custom activity fields.

Please consider fixing this issue for the benefit of Elsa users. I am using Elsa 3.2.0.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.