elsa-workflows / elsa-workflows/elsa-core

How to implement repeated execution of HttpEndpoint in Elsa3?

Open
#5,280 2 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

```
builder.Root = new Sequence
{
Activities =
{
new If(context => context.GetContext() != null)
{
Then = new Fork{
Branches =
{
While.True(new Sequence(){
Activities =
{
new HttpEndpoint
{
Path = new("/dispatch-service/dispatch"),
SupportedMethods = new(new[] { HttpMethods.Post }),
CanStartWorkflow = true,
ParsedContent = new(httpRequestContext)
},
new WriteHttpResponse(){ Content=new ("111")},
}
}),// 'dispatch'
feedbackActivity,// 'feedback'
},
JoinMode = ForkJoinMode.WaitAny,
},
Else = finishActivity
}
}
};

```
As above, I want to be able to execute the 'dispatch ' method multiple times, but in fact it can only be executed once same as 'feedback'. ‘While.True’ didn't work the way I thought it would. Is there any problem with this way of writing and how to solve it? Thank you.
By the way i start workflow by 'dispatch' request.

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.