elsa-core/src/samples/Sample01/Program.cs
Sipke Schoorstra c7c41d10a5
Workflow Registry refresh upon workflow definition updates (#101)
* Fix many things. Few more samples left to fix

* Fix all the samples

* Introduce service configurator

* Implement cache signaling and refreshing workflow registry

* Add Sample16 demonstrating dashboard + workflow host combined

* Bugfix where non-published versions of worklows are triggered
2019-10-23 21:23:25 +02:00

31 lines
896 B
C#

using System;
using System.Threading.Tasks;
using Elsa.Persistence.Memory;
using Elsa.Services;
using Microsoft.Extensions.DependencyInjection;
using Sample01.Activities;
namespace Sample01
{
/// <summary>
/// A minimal workflows program defined in code with a strongly-typed workflow class.
/// </summary>
internal static class Program
{
private static async Task Main(string[] args)
{
// Setup a service collection.
var services = new ServiceCollection()
.AddWorkflows()
.AddActivity<HelloWorld>()
.AddActivity<GoodByeWorld>()
.BuildServiceProvider();
// Invoke the workflow.
var invoker = services.GetService<IWorkflowInvoker>();
await invoker.StartAsync<HelloWorldWorkflow>();
Console.ReadLine();
}
}
}