Skip to content

If using EndWorkflow() no event for WorkflowCompleted LifeCycleEvent #1353

Open
@JanPhillip20

Description

@JanPhillip20

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions