elsa-core/test/Elsa.IntegrationTests/Activities/Break/BreakWhileWorkflow.cs
Sipke Schoorstra fccf4737e2
V3 modular configuration (#3070)
* Restructuring (WIP)

* Fix warnings

* Move DSL to modules

* Update namespaces

* Make design factory base reusable

* Update service registrations

* Remove unused namespaces and rename ElsaDbContext

* Incremental work on migrations

* Generate WorkflowsDbContext SQLite migrations

* Rename ServiceCollectionExtensions

* Update DbContextOptionsBuilderExtensions.cs

* Restructure

* Configuration refactorings (WIP)

* Incremental work on configurator API

* Incremental work on configuration API

* Incremental work on configuration API

* Fix workflow runtime options

* Move standard stream providers

* Implement configurator dependencies

* Cleanup configurator API

* Update configurator dependencies

* Cleanup

* Update Label API endpoints

* Fix eager configuration issue
2022-05-26 12:47:31 +02:00

39 lines
1.2 KiB
C#

using Elsa.Workflows.Core.Activities;
using Elsa.Workflows.Core.Models;
using Elsa.Workflows.Core.Services;
namespace Elsa.IntegrationTests.Activities;
public class BreakWhileWorkflow : WorkflowBase
{
protected override void Build(IWorkflowDefinitionBuilder workflow)
{
var currentValue = new Variable<int?>(0);
workflow.WithRoot(new Sequence
{
Variables = { currentValue },
Activities =
{
new WriteLine("Start"),
While.True(new Sequence
{
Activities =
{
new SetVariable
{
Variable = currentValue,
Value = new Input<object?>(context => currentValue.Get(context) + 1)
},
new If(context => currentValue.Get(context) == 3)
{
Then = new Break()
},
new WriteLine(context => currentValue.Get(context).ToString()),
}
}),
new WriteLine("End"),
}
});
}
}