Skip to content

Commit 6e52198

Browse files
committed
fix(Correlator): Fixed the CorrelationHandler to set correlated events as the input of the workflow instance to create when the òutcome` has been set to instantiate
Signed-off-by: Charles d'Avernas <[email protected]>
1 parent b451093 commit 6e52198

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Synapse.sln

-3
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Synapse.Runtime.Kubernetes"
134134
EndProject
135135
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Synapse.Core.Infrastructure.Containers.Docker", "src\core\Synapse.Core.Infrastructure.Containers.Docker\Synapse.Core.Infrastructure.Containers.Docker.csproj", "{DD6381BD-2C8B-4CE1-99B2-EC585DD818FA}"
136136
EndProject
137-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "kubernetes", "kubernetes", "{B3F3DB1B-23E7-45FA-8934-448BFFB294E8}"
138-
EndProject
139137
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Synapse.Core.Infrastructure.Containers.Kubernetes", "src\core\Synapse.Core.Infrastructure.Containers.Kubernetes\Synapse.Core.Infrastructure.Containers.Kubernetes.csproj", "{41C99069-BD99-4FD2-BF33-984CF03B53E8}"
140138
EndProject
141139
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{35D495F4-D267-4A84-9479-DB3C1BE85434}"
@@ -292,7 +290,6 @@ Global
292290
{8FF58403-9E13-4F58-864F-E6FBC877BF37} = {175CE1C5-FE17-4C8B-8823-E812BAD4E527}
293291
{9B37AA4A-A342-4A41-A2A1-C8466825A70A} = {175CE1C5-FE17-4C8B-8823-E812BAD4E527}
294292
{DD6381BD-2C8B-4CE1-99B2-EC585DD818FA} = {9E296C8A-4D78-4592-B046-11A3A953FD25}
295-
{B3F3DB1B-23E7-45FA-8934-448BFFB294E8} = {562C91A3-6E91-4489-9D9D-064E7436D900}
296293
{41C99069-BD99-4FD2-BF33-984CF03B53E8} = {9E296C8A-4D78-4592-B046-11A3A953FD25}
297294
{AB30A91B-0158-411D-9BD3-36FFA441B3A2} = {35D495F4-D267-4A84-9479-DB3C1BE85434}
298295
{06404855-A5BE-4556-91BC-064630E95737} = {35D495F4-D267-4A84-9479-DB3C1BE85434}

src/api/Synapse.Api.Server/appsettings.Development.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
}
2020
},
2121
"CloudEvents": {
22-
"Endpoint": "https://webhook.site/a4aff725-0711-48b2-a9d2-5d1b806d04d0"
22+
"Endpoint": "http://localhost:5151/api/events/pub"
2323
}
2424
}

src/correlator/Synapse.Correlator/Services/CorrelationHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ protected virtual async Task CreateOrUpdateContextAsync(CorrelationContext conte
361361
await this.Resources.PatchStatusAsync<WorkflowInstance>(new(PatchType.JsonPatch, patch), workflowInstance.GetName(), workflowInstance.GetNamespace(), null, false, cancellationToken).ConfigureAwait(false);
362362
break;
363363
case CorrelationOutcomeType.Start:
364-
var input = this.Correlation.Resource.Spec.Outcome.Start!.Input == null ? [] : await this.ExpressionEvaluator.EvaluateAsync<EquatableDictionary<string, object>>(this.Correlation.Resource.Spec.Outcome.Start!.Input!, context, cancellationToken: cancellationToken).ConfigureAwait(false);
364+
var input = (this.Correlation.Resource.Spec.Outcome.Start!.Input == null ? new() { { "events", context.Events.Values } } : await this.ExpressionEvaluator.EvaluateAsync<EquatableDictionary<string, object>>(this.Correlation.Resource.Spec.Outcome.Start!.Input!, context, cancellationToken: cancellationToken).ConfigureAwait(false));
365365
workflowInstance = new()
366366
{
367367
Metadata = new()

0 commit comments

Comments
 (0)