elsa-core/test/Elsa.IntegrationTests/Activities/If/ComplexIfWorkflow.cs

40 lines
1 KiB
C#
Raw Normal View History

2022-04-20 13:52:51 +00:00
using System;
using Elsa.Workflows.Core.Activities;
using Elsa.Workflows.Core.Services;
2022-04-20 13:52:51 +00:00
namespace Elsa.IntegrationTests.Activities;
public class ComplexIfWorkflow : WorkflowBase
2022-04-20 13:52:51 +00:00
{
private readonly Func<bool> _condition;
public ComplexIfWorkflow(Func<bool> condition)
{
_condition = condition;
}
2022-08-25 11:45:35 +00:00
protected override void Build(IWorkflowBuilder workflow)
2022-04-20 13:52:51 +00:00
{
workflow.WithRoot(new Sequence
{
Activities =
{
new WriteLine("Start"),
new If(_condition)
2022-04-20 13:52:51 +00:00
{
Then = new Sequence(
new WriteLine("Executing"),
new WriteLine("True!")
),
Else = new Sequence(
new WriteLine("Executing"),
new WriteLine("False!")
)
2022-04-20 13:52:51 +00:00
},
new WriteLine("End")
}
});
}
}