elsa-core/samples/Sample11/CorrelationWorkflow.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

21 lines
954 B
C#

using Elsa.Activities.Console.Activities;
using Elsa.Activities.Primitives;
using Elsa.Activities.Workflows;
using Elsa.Expressions;
using Elsa.Services;
using Elsa.Services.Models;
namespace Sample11
{
public class CorrelationWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.StartWith<WriteLine>(activity => activity.TextExpression = new JavaScriptExpression<string>("`Workflow started with correlation ID \"${correlationId()}\".`"))
.Then<Signaled>(activity => activity.Signal = new PlainTextExpression("Proceed"))
.Then<WriteLine>(activity => activity.TextExpression = new JavaScriptExpression<string>("`Signal received for workflow with correlation ID: \"${correlationId()}\"`"))
.Then<WriteLine>(activity => activity.TextExpression = new PlainTextExpression("Workflow finished."));
}
}
}