elsa-core/samples/console/Elsa.Samples.ConsoleApp.LoopingWorkflows
2024-02-02 20:01:14 +02:00
..
Workflows Move samples to repository root 2024-02-02 20:01:14 +02:00
Elsa.Samples.ConsoleApp.LoopingWorkflows.csproj Move samples to repository root 2024-02-02 20:01:14 +02:00
Program.cs Move samples to repository root 2024-02-02 20:01:14 +02:00
Readme.md Move samples to repository root 2024-02-02 20:01:14 +02:00

Looping Workflows

This sample demonstrates three activities that can be used to model looping constructs.

For

The For activity executes a child activity for each step between a start and end value, similar to the following C# code:

for(var i = 0; i < 10; i++)
{
   // Logic to execute for each iteration.
}

ForEach

The ForEach activity executes a child activity for each item in a list, similar to the following C# code:

foreach(var item in items)
{
   // Logic to execute for each iteration.
}

While

The While activity executes a child activity for each iteration for as long as a certain condition evaluates to true, similar to the following C# code:

while(SomeConditionIstrue)
{
   // Logic to execute for each iteration.
}