elsa-core/test/Elsa.IntegrationTests/Scenarios/BlockingAndBreaking/Workflows.cs
Sipke Schoorstra 8a4e219e07 Minor renaming
2022-11-23 11:20:35 +01:00

52 lines
1.8 KiB
C#

using Elsa.Workflows.Core.Activities;
using Elsa.Workflows.Core.Models;
using Elsa.Workflows.Core.Services;
namespace Elsa.IntegrationTests.Scenarios.BlockingAndBreaking;
public class BreakWhileBlockForkWorkflow : WorkflowBase
{
protected override void Build(IWorkflowBuilder workflow)
{
var currentValue = new Variable<int?>(0);
workflow.WithVariable(currentValue);
workflow.WithRoot(new While(() => true)
{
Body =
new Sequence
{
Activities =
{
new Fork
{
JoinMode = ForkJoinMode.WaitAll,
Branches =
{
new Sequence
{
Activities =
{
new WriteLine("Branch 1"),
new Event("Branch 1") { Id = "Branch 1" },
new WriteLine("Branch 1 - Resumed"),
new Break()
}
},
new Sequence
{
Activities =
{
new WriteLine("Branch 2"),
new Event("Branch 2") { Id = "Branch 2" },
new WriteLine("Branch 2 - Resumed"),
}
}
}
}
}
}
});
}
}