2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Features.Services;
|
2022-06-29 13:36:27 +00:00
|
|
|
using Elsa.Workflows.Core.Activities;
|
2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Workflows.Management.Features;
|
2022-05-26 10:47:31 +00:00
|
|
|
|
2022-12-31 15:16:43 +00:00
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
|
namespace Elsa.Extensions;
|
2022-05-26 10:47:31 +00:00
|
|
|
|
2022-11-19 21:30:43 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Provides extensions to the specified <see cref="IModule"/>/
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class ModuleExtensions
|
2022-05-26 10:47:31 +00:00
|
|
|
{
|
2022-11-19 21:30:43 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the workflow management feature to the specified module.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IModule UseWorkflowManagement(this IModule module, Action<WorkflowManagementFeature>? configure = default)
|
2022-05-26 10:47:31 +00:00
|
|
|
{
|
2022-06-29 13:36:27 +00:00
|
|
|
module.Configure<WorkflowManagementFeature>(management =>
|
|
|
|
|
{
|
|
|
|
|
management.AddActivity<NotFoundActivity>();
|
|
|
|
|
configure?.Invoke(management);
|
|
|
|
|
});
|
2022-05-27 10:36:39 +00:00
|
|
|
return module;
|
2022-05-26 10:47:31 +00:00
|
|
|
}
|
|
|
|
|
}
|