using Elsa.Features.Services;
using Elsa.Workflows.Core.Services;
using Elsa.Workflows.Runtime.Features;
// ReSharper disable once CheckNamespace
namespace Elsa.Extensions;
///
/// Adds extensions to setup the feature.
///
public static class ModuleExtensions
{
///
/// Enables the feature.
///
public static IModule UseWorkflowRuntime(this IModule module, Action? configure = default)
{
module.Configure(configure);
return module;
}
///
/// Register the specified workflow type.
///
public static IModule AddWorkflow(this IModule module) where T : IWorkflow
{
module.Configure().AddWorkflow();
return module;
}
public static WorkflowRuntimeFeature UseDefaultRuntime(this WorkflowRuntimeFeature feature, Action? configure = default)
{
feature.Module.Configure(configure);
return feature;
}
public static WorkflowRuntimeFeature UseExecutionLogRecords(this WorkflowRuntimeFeature feature, Action? configure = default)
{
feature.Module.Configure(configure);
return feature;
}
public static WorkflowRuntimeFeature UseAsyncWorkflowStateExporter(this WorkflowRuntimeFeature feature, Action? configure = default)
{
feature.Module.Configure(configure);
return feature;
}
}