Description
Describe the bug
If I use EndWorkflow() at the end of my workflow, no LifeCycleEvent is published, but the workflow status is “Completed”.
To Reproduce
minimal example to reproduce:
public void Build(IWorkflowBuilder builder)
{
builder.UseDefaultErrorBehavior(WorkflowErrorHandling.Terminate)
.StartWith(context => { Console.WriteLine("Starting workflow"); })
.Then(context => { Console.WriteLine("processing"); })
.EndWorkflow();
}
subscribe to the LifeCycleEvents:
workflowHost.OnLifeCycleEvent += (evt) =>
{
switch (evt)
{
case WorkflowStarted workflowStartedEvent:
this.Logger.LogInformation($"Workflow started: {workflowStartedEvent.Reference}");
break;
case WorkflowCompleted workflowCompletedEvent:
this.Logger.LogInformation($"Workflow completed: {workflowCompletedEvent.Reference}");
break;
case WorkflowTerminated workflowErrorEvent:
this.Logger.LogError($"Workflow error: {workflowErrorEvent.Reference}");
break;
case WorkflowSuspended workflowSuspendedEvent:
this.Logger.LogInformation($"Workflow suspended: {workflowSuspendedEvent.Reference}");
break;
}
};
Expected behavior
I expect the ‘Completed’ LifeCycleEvent to be published even when using EndWorkflow()
Additional context
Add any other context about the problem here.