elsa-workflows / elsa-workflows/elsa-core

Compensable activity loops infinitly when an exception is thrown in Compensate branch

Open
#4,541 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

Hello, I have the following workflow

```cs
public class CompensationWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.StartWith(compensable =>
{
compensable.When(OutcomeNames.Compensate)
.If(ctx => ctx.GetVariable("activity1Passed"))
.Then();
compensable.When(OutcomeNames.Done)
.Then()
.SetVariable("activity1Passed", true)
.Then()
.Then();
}).WithName("Compensable1");
}
}
```

When the Compensate outcom is triggered the workflow execution loops over UndoActivity1 because it throws an exception.
How to just fail the workflow and return a faulted status ?
Thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.