elsa-core/samples/console/Elsa.Samples.ConsoleApp.HelloWorld/Program.cs
Sipke Schoorstra 3a4f690a3e Make workflow runtime methods accept nullable options
The methods in the workflow runtime now accept nullable runtime options. Providing workflow options is now optional - if no options are provided, default values are used. Changes have been applied across all relevant methods in IWorkflowRuntime, ProtoActorWorkflowRuntime and DefaultWorkflowRuntime classes, thus ensuring consistent behavior and null safety across the workflow runtime.
2024-02-04 22:15:02 +01:00

22 lines
680 B
C#

using Elsa.Extensions;
using Elsa.Workflows.Activities;
using Elsa.Workflows.Contracts;
using Microsoft.Extensions.DependencyInjection;
// Setup service container.
var services = new ServiceCollection();
// Add Elsa services.
services.AddElsa();
// Build service container.
var serviceProvider = services.BuildServiceProvider();
// Define a simple workflow, which in this case is a very simple activity that writes something to the console:
var workflow = new WriteLine("Hello world!");
// Resolve a workflow runner to run the workflow.
var workflowRunner = serviceProvider.GetRequiredService<IWorkflowRunner>();
// Run the workflow.
await workflowRunner.RunAsync(workflow);