elsa-workflows / elsa-workflows/elsa-core
[BUG]Cannot break a Flowchart in While
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
When a While’s Body is a flowchart , and there is a Break as a Then activity in a If, I found that I cannot break the While.
```
While w = new() {
Body = new Flowchart() {
Activities = {
new WriteLine(“Do1”),
new If(e => true) {
Then = new Break(),
},
new WriteLine(“Do2”),
}
// Connected like Sequence
}
};
```
**Also**, without the while , I cannot terminate the flowchart when the Then activity is End.
```
Flowchart chart = new() {
Activities = {
new WriteLine(“Do1”),
new If(e => true) {
Then = new End(),
},
new WriteLine(“Do2”)
}
// Connected like Sequence
}
```
## Expected Behavior
- For first example, it should output **“Do1”** as expected.
- For second example, it should output **“Do1”** as expected.
## Actual Behavior
- For first example, it outputted **”Do1” “Do2”** in actual.
- For second example, it outputted **“Do1” “Do2”** in actual.
## Environment
- **Elsa Package Version**: 3.1.3.
- **Operating System**: Windows 10
- **Browser and Version**: No browser.
## Troubleshooting Attempts
It seems `Flowchart` doesn’t receive `BreakSignal` and judge whether `IsBreak` in `OnChildCompletedAsync` method of `Flowchart`.
I have tried to substitute `Flowchart` with `Sequence` and it goes well.
Contributor guide
Assessment
This issue has not been assessed yet.