elsa-core/samples/Sample05/RecurringWorkflow.cs
Sipke Schoorstra 7fb6153e0a
Refactored versioning (#67)
* Fix StringValues serialization and rename WorkflowDefinition to WorkflowDefinitionVersion

* Fix Singleton issue and add support for absolute URL using base URL for background tasks

* Fix persistence and lifetime scope issues

* Fix timer bugs

* Various bug fixes
2019-09-15 12:16:24 +02:00

22 lines
750 B
C#

using System;
using Elsa.Activities.Console.Activities;
using Elsa.Activities.Timers.Activities;
using Elsa.Expressions;
using Elsa.Services;
using Elsa.Services.Models;
namespace Sample05
{
public class RecurringWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.WithId("RecurringWorkflow")
.AsSingleton()
.StartWith<TimerEvent>(x => x.TimeoutExpression = new PlainTextExpression<TimeSpan>("00:00:05"), "Timer")
.Then<WriteLine>(x => x.TextExpression = new JavaScriptExpression<string>("`Trigger received. The time is: ${new Date().toISOString()}`"))
.Then("Timer");
}
}
}