elsa-core/samples/Sample06/HelloWorldWorkflow.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

27 lines
956 B
C#

using System;
using System.Net;
using Elsa.Activities.Http.Activities;
using Elsa.Expressions;
using Elsa.Services;
using Elsa.Services.Models;
namespace Sample06
{
public class HelloWorldWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.StartWith<HttpRequestEvent>(activity => activity.Path = new Uri("/hello-world", UriKind.RelativeOrAbsolute))
.Then<HttpResponseAction>(
activity =>
{
activity.Content = new PlainTextExpression("<h1>Hello World!</h1><p>Elsa says hi :)</p>");
activity.ContentType = "text/html";
activity.StatusCode = HttpStatusCode.OK;
activity.ResponseHeaders = new PlainTextExpression("X-Powered-By=Elsa Workflows");
}
);
}
}
}