2020-11-17 20:28:17 +00:00
|
|
|
using Elsa.Samples.ForkJoinTimerAndSignalHttp.BackgroundTasks;
|
|
|
|
|
using Elsa.Samples.ForkJoinTimerAndSignalHttp.Workflows;
|
2020-11-17 20:26:31 +00:00
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using NodaTime;
|
|
|
|
|
|
2020-11-17 20:28:17 +00:00
|
|
|
namespace Elsa.Samples.ForkJoinTimerAndSignalHttp
|
2020-11-17 20:26:31 +00:00
|
|
|
{
|
|
|
|
|
public class Startup
|
|
|
|
|
{
|
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
services
|
|
|
|
|
.AddControllers();
|
|
|
|
|
|
|
|
|
|
services
|
|
|
|
|
.AddElsa()
|
|
|
|
|
.AddConsoleActivities()
|
|
|
|
|
.AddTimerActivities(options => options.SweepInterval = Duration.FromSeconds(1))
|
|
|
|
|
.AddHostedService<WorkflowStarter<DemoWorkflow>>()
|
|
|
|
|
.AddWorkflow<DemoWorkflow>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Configure(IApplicationBuilder app)
|
|
|
|
|
{
|
|
|
|
|
app.UseRouting();
|
|
|
|
|
app.UseEndpoints(endpoints => endpoints.MapControllers());
|
|
|
|
|
app.UseWelcomePage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|