@@ -345,15 +345,15 @@ public virtual async Task SetResultAsync(object? result, string? then = FlowDire
345345 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 ) ;
346346 if ( this . Task . Definition . Export ? . As is string toExpression )
347347 {
348- var context = ( await this . Task . Workflow . Expressions . EvaluateAsync < IDictionary < string , object > > ( toExpression , this . Task . ContextData , arguments , cancellationToken ) . ConfigureAwait ( false ) ) ! ;
348+ var context = ( await this . Task . Workflow . Expressions . EvaluateAsync < IDictionary < string , object > > ( toExpression , output ?? new ( ) , arguments , cancellationToken ) . ConfigureAwait ( false ) ) ! ;
349349 await this . Task . SetContextDataAsync ( context , cancellationToken ) . ConfigureAwait ( false ) ;
350350 }
351351 else if ( this . Task . Definition . Export ? . As != null )
352352 {
353- var context = ( await this . Task . Workflow . Expressions . EvaluateAsync < IDictionary < string , object > > ( this . Task . Definition . Export . As , this . Task . ContextData , arguments , cancellationToken ) . ConfigureAwait ( false ) ) ! ;
353+ var context = ( await this . Task . Workflow . Expressions . EvaluateAsync < IDictionary < string , object > > ( this . Task . Definition . Export . As , output ?? new ( ) , arguments , cancellationToken ) . ConfigureAwait ( false ) ) ! ;
354354 await this . Task . SetContextDataAsync ( context , cancellationToken ) . ConfigureAwait ( false ) ;
355355 }
356- await this . AfterExecuteAsync ( cancellationToken ) . ConfigureAwait ( false ) ; //todo: act upon last directive
356+ await this . AfterExecuteAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
357357 await this . DoSetResultAsync ( output , then , cancellationToken ) . ConfigureAwait ( false ) ;
358358 await this . Task . SetResultAsync ( output , then , cancellationToken ) . ConfigureAwait ( false ) ;
359359 this . Subject . OnNext ( new TaskLifeCycleEvent ( TaskLifeCycleEventType . Completed ) ) ;
0 commit comments