Skip to content

Commit

Permalink
fix(Runner): Fixed the TaskExecutor to ignore both output.as and …
Browse files Browse the repository at this point in the history
…`export.as` clauses for skipped tasks

Fixes #481

Signed-off-by: Charles d'Avernas <[email protected]>
  • Loading branch information
cdavernas committed Jan 22, 2025
1 parent c7c818c commit 45c22a1
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/runner/Synapse.Runner/Services/TaskExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,20 +379,6 @@ public virtual async Task SkipAsync(object? result, string? then = FlowDirective
this.Stopwatch.Stop();
if (string.IsNullOrWhiteSpace(then)) then = FlowDirective.Continue;
var output = result;
var arguments = this.GetExpressionEvaluationArguments() ?? new Dictionary<string, object>();
arguments[RuntimeExpressions.Arguments.Output] = output!;
if (this.Task.Definition.Output?.As is string fromExpression) output = await this.Task.Workflow.Expressions.EvaluateAsync<object>(fromExpression, output ?? new(), arguments, cancellationToken).ConfigureAwait(false);
else if (this.Task.Definition.Output?.As != null) output = await this.Task.Workflow.Expressions.EvaluateAsync<object>(this.Task.Definition.Output.As, output ?? new(), arguments, cancellationToken).ConfigureAwait(false);
if (this.Task.Definition.Export?.As is string toExpression)
{
var context = (await this.Task.Workflow.Expressions.EvaluateAsync<IDictionary<string, object>>(toExpression, this.Task.ContextData, arguments, cancellationToken).ConfigureAwait(false))!;
await this.Task.SetContextDataAsync(context, cancellationToken).ConfigureAwait(false);
}
else if (this.Task.Definition.Export?.As != null)
{
var context = (await this.Task.Workflow.Expressions.EvaluateAsync<IDictionary<string, object>>(this.Task.Definition.Export.As, this.Task.ContextData, this.GetExpressionEvaluationArguments(), cancellationToken).ConfigureAwait(false))!;
await this.Task.SetContextDataAsync(context, cancellationToken).ConfigureAwait(false);
}
await this.Task.SkipAsync(output, then, cancellationToken).ConfigureAwait(false);
this.Subject.OnNext(new TaskLifeCycleEvent(TaskLifeCycleEventType.Skipped));
this.Subject.OnCompleted();
Expand Down

0 comments on commit 45c22a1

Please sign in to comment.