Commit 48b574a
Added logic to search for workflow-as-activities based on DefinitionId (not only versionId) (#7149)
* Inital commit:
1. Fixed problem: (re-)added logic to search for workflow-as-activities based on DefinitionId (not only versionId)
2. Added tests for Deserialiazation so this logic cannot disappear "unnoticed" in the future.
* Found one flaw:
workflowDefinitionId is also used in other activities. Therefore, we must make sure to only search by workflowDefinitionId when the value is a string (e.g. when workflow used as activity, the value will always be a constant string, because the workflowDefinitionId cannot be resolved using expressions)
* Final attempt:
1) First try to find the activity by type name
2) Even if a descriptor is found by its type name, there might be multiple versions of a workflow-as-activity, hence; if the workflowDefinitionVersionId is specified, then this can override the initially found activity descriptor by type name.
3) Lastly, only when no activity descriptor is found by type name AND the activity JSON contains the property "workflowDeftinitionId", then we can search by workflowDefinitionId
* Add `net8.0` and `net9.0` targets, update package versions for resilience libraries.
* Exclude `net10.0` target framework from MySQL EF Core project due to Pomelo compatibility constraints.
* Remove unnecessary whitespace in MySQL EF Core project file
* Refactor `ActivityJsonConverterTests` to streamline registry setup and improve readability.
* Adds null activity descriptor lookup mock
Ensures the custom property lookup path is tested by mocking type name lookups to return null when searching for ActivityDescriptors.
* Fix activity descriptor override assignment in `ActivityJsonConverter`
Corrects the assignment logic for `activityDescriptor` and ensures `activityTypeVersion` uses the overridden descriptor's version when a custom property match is found.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor `ActivityJsonConverter` for readability and logic improvements
- Adjust null-check handling for `activityDescriptor` overrides.
- Improve comment clarity and consolidate lambda expressions.
- Remove unnecessary whitespace.
* Add blob extension handling to `BlobStorageWorkflowsProvider`
- Introduce `BlobExtensions` for extracting blob file extensions.
- Add `SupportsExtension` to `IBlobWorkflowFormatHandler` to filter handlers by supported extensions.
* Remove unused workflow files and references in `Elsa.Server.Web`
- Deleted `flowchart-test.elsa` and `multi-workflow-example.elsa`.
- Removed corresponding references from the project file.
---------
Co-authored-by: Joey Barten - Founder Orbyss <joey.barten@unfussiness.io>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 4bbdd6f commit 48b574a
10 files changed
Lines changed: 410 additions & 67 deletions
File tree
- src
- apps/Elsa.Server.Web
- Workflows
- modules
- Elsa.Persistence.EFCore.MySql
- Elsa.WorkflowProviders.BlobStorage
- Extensions
- Providers
- Elsa.Workflows.Core/Serialization/Converters
- test/unit/Elsa.Workflows.Core.UnitTests/Serialization/Converters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
This file was deleted.
Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
Lines changed: 32 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 84 | + | |
92 | 85 | | |
93 | 86 | | |
94 | | - | |
| 87 | + | |
95 | 88 | | |
96 | 89 | | |
97 | 90 | | |
98 | 91 | | |
99 | 92 | | |
100 | | - | |
| 93 | + | |
101 | 94 | | |
102 | 95 | | |
103 | 96 | | |
104 | 97 | | |
105 | 98 | | |
106 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
110 | 131 | | |
111 | 132 | | |
112 | 133 | | |
| |||
115 | 136 | | |
116 | 137 | | |
117 | 138 | | |
118 | | - | |
| 139 | + | |
119 | 140 | | |
120 | 141 | | |
121 | 142 | | |
| |||
0 commit comments