Skip to content

Commit 87d1a3b

Browse files
committed
fix(Worker): Fixed the AsyncFunctionProcessor to properly filter the trigger event's data
1 parent f862afc commit 87d1a3b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/apps/Synapse.Server/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"CloudEvents": {
1616
"Sink": {
17-
"Uri": "https://webhook.site/2e78793f-69a5-4ef6-8fdf-d467a9d6f1c6"
17+
"Uri": "https://webhook.site/70e57ac3-c28c-41cc-9a61-070810da8b3b"
1818
}
1919
}
2020
}

src/apps/Synapse.Worker/Services/Processors/AsyncFunctionProcessor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
102102
if (this.Activity.Status == V1WorkflowActivityStatus.Pending)
103103
{
104104
var input = await this.Context.FilterInputAsync(this.Action, this.Activity.Input.ToObject()!, cancellationToken);
105+
if (!string.IsNullOrWhiteSpace(this.Action.Event!.DataExpression)) input = await this.Context.EvaluateAsync(this.Action.Event!.DataExpression, input, cancellationToken);
106+
else if (this.Action.Event.Data != null) input = await this.Context.EvaluateObjectAsync(this.Action.Event!.Data.ToObject()!, input!, cancellationToken);
105107
var metadata = new Dictionary<string, string>()
106108
{
107109
{ V1WorkflowActivityMetadata.State, this.State.Name },

0 commit comments

Comments
 (0)