elsa-core/samples/Sample06/HelloWorldWorkflow.cs
Sipke Schoorstra 69116727be
Fixed lifetime scope issues with Workflow Invoker and many other bugs (#70)
* Refactor workflow invoker to execute in finite scope

* Fix Timer Event and workflow instance concurrency issue
2019-09-18 22:14:52 +02:00

29 lines
982 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.Relative)
)
.Then<HttpResponseAction>(
activity =>
{
activity.Content = new LiteralExpression("<h1>Hello World!</h1><p>Elsa says hi :)</p>");
activity.ContentType = "text/html";
activity.StatusCode = HttpStatusCode.OK;
activity.ResponseHeaders = new LiteralExpression("X-Powered-By=Elsa Workflows");
}
);
}
}
}