danielgerlag / danielgerlag/workflow-core
Support for Specifying Input Data Type for Assignee in Workflow Serialization
- Dominant language
- C#
- Stars
- 5.9k
- Forks
- 1.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 5
Description
In the current implementation, the Assignee in the workflow below cannot be directly converted into a C# class. While this feature may already exist, there is no clear mechanism for specifying the input data type explicitly.
To enhance flexibility and ensure correct deserialization, I propose adding support for specifying the input data type using a property such as:
`"DataType": "Workflow.Domain.Data, Workflow.Domain"`
This enhancement would allow the deserializer to recognize the intended type and deserialize the object accordingly.
Proposed Solution:
• Introduce a mechanism for specifying the input data type within the workflow definition.
• Modify the deserializer to interpret the DataType field and convert the data into the corresponding C# class.
Potential Benefits:
• Improved type safety in workflow processing.
• Enhanced extensibility for handling complex workflow objects.
• More robust and maintainable serialization/deserialization.
Please let me know if this feature is already available or if it can be considered for implementation. Thank you!
C# class
`public class AssigneeInfo
{
public int Id { get; set; }
public string? Name { get; set; }
public int MemberType { get; set; }
}`
Flow Definition:
`{
"Id" : "ce54eaf9-eab1-4ce0-a9c8-3a426bb7569a",
"Version" : 1,
"DataType" : "Workflow.Domain.Data, Workflow.Domain",
"Steps" : [ {
"Id" : "6fe991a3-1066-4707-97eb-4d54d398f1e3",
"StepType" : "Workflow.Domain.Steps.AssignTaskWait, Workflow.Domain",
"Inputs" : {
"Assignee" : {
"id" : 1,
"name" : "User Admin",
"memberType" : 1
},
"Reason" : "3"
}
} ]
}`
Contributor guide
No contributing guide indexed for this repository
Research direction
No files or tests are identified in the issue. Start by locating the workflow serialization and deserialization entry points, then trace how the root DataType and Inputs.Assignee are resolved; use the supplied workflow JSON and AssigneeInfo class to define a test proving the requested type is honored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100