Ensure ResultVariable is declared in workflow memory space

This commit is contained in:
Sipke Schoorstra 2023-04-28 15:15:54 +02:00
parent ed3581569b
commit 6c7c62a8a2

View file

@ -51,6 +51,11 @@ public class Workflow : Composite, ICloneable
{
}
public WorkflowIdentity Identity { get; set; } = WorkflowIdentity.VersionOne;
public WorkflowPublication Publication { get; set; } = WorkflowPublication.LatestAndPublished;
public WorkflowMetadata WorkflowMetadata { get; set; } = new();
public WorkflowOptions? Options { get; set; }
/// <summary>
/// Constructs a new <see cref="Workflow"/> from the specified <see cref="IActivity"/>.
/// </summary>
@ -66,10 +71,14 @@ public class Workflow : Composite, ICloneable
return register;
}
public WorkflowIdentity Identity { get; set; } = WorkflowIdentity.VersionOne;
public WorkflowPublication Publication { get; set; } = WorkflowPublication.LatestAndPublished;
public WorkflowMetadata WorkflowMetadata { get; set; } = new();
public WorkflowOptions? Options { get; set; }
/// <inheritdoc />
protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
{
if(ResultVariable != null)
context.WorkflowExecutionContext.MemoryRegister.Declare(ResultVariable);
await base.ExecuteAsync(context);
}
/// <summary>
/// Create a shallow copy of this workflow.