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

46 lines
1.2 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.Root = new Sequence
2022-04-20 13:52:51 +00:00
{
Activities =
{
new WriteLine("Start"),
new If(_condition)
2022-04-20 13:52:51 +00:00
{
2022-12-07 20:05:24 +00:00
Then = new Sequence
{
Activities =
{
new WriteLine("Executing"),
new WriteLine("True!")
}
},
Else = new Sequence
{
Activities =
{
new WriteLine("Executing"),
new WriteLine("False!")
}
}
2022-04-20 13:52:51 +00:00
},
new WriteLine("End")
}
};
2022-04-20 13:52:51 +00:00
}
}