Deprecate and clean up legacy workflow runtime components.

Marked various types as obsolete, advising migration to `CreateClientAsync` methods or `IBookmarkQueue` services. Removed unused `Deprecated` namespace imports, aligning code with updated runtime standards.
This commit is contained in:
Sipke Schoorstra 2025-01-28 09:26:46 +01:00
parent ee883dbd07
commit 9f01e148a9
14 changed files with 12 additions and 8 deletions

View file

@ -1,4 +1,3 @@
using Elsa.Workflows.Runtime.Deprecated;
using Elsa.Workflows.Runtime.Entities;
using Elsa.Workflows.Runtime.Filters;
using Elsa.Workflows.Runtime.Matches;

View file

@ -1,5 +1,4 @@
using Elsa.Workflows.Management;
using Elsa.Workflows.Runtime.Deprecated;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Workflows.Runtime.Distributed;

View file

@ -1,4 +1,3 @@
using Elsa.Workflows.Runtime.Deprecated;
using Elsa.Workflows.Runtime.Distributed;
using Elsa.Workflows.Runtime.Entities;
using Elsa.Workflows.Runtime.Filters;

View file

@ -1,4 +1,3 @@
using Elsa.Workflows.Runtime.Deprecated;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Workflows.Runtime.ProtoActor.Services;

View file

@ -8,4 +8,5 @@ namespace Elsa.Workflows.Runtime.Filters;
/// <param name="ActivityTypeName">The activity type name to trigger workflows for.</param>
/// <param name="BookmarkPayload">The bookmark payload to trigger workflows for.</param>
/// <param name="Options">The options to use when triggering workflows.</param>
[Obsolete("This type is obsolete. Use the new CreateClientAsync methods of IWorkflowRuntime instead.")]
public record WorkflowsFilter(string ActivityTypeName, object BookmarkPayload, TriggerWorkflowsOptions Options);

View file

@ -3,6 +3,7 @@ namespace Elsa.Workflows.Runtime.Options;
/// <summary>
/// Options for triggering workflows.
/// </summary>
[Obsolete("This type is obsolete. Use the new CreateClientAsync methods of IWorkflowRuntime instead.")]
public class TriggerWorkflowsOptions
{
public string? CorrelationId { get; set; }

View file

@ -5,6 +5,7 @@ namespace Elsa.Workflows.Runtime.Parameters;
/// <summary>
/// Options for resuming workflows.
/// </summary>
[Obsolete("This type is obsolete. Use the new CreateClientAsync methods of IWorkflowRuntime instead.")]
public class ResumeWorkflowRuntimeParams
{
public string? CorrelationId { get; set; }

View file

@ -5,6 +5,7 @@ namespace Elsa.Workflows.Runtime.Parameters;
/// <summary>
/// Represents parameters for starting a workflow.
/// </summary>
[Obsolete("This type is obsolete. Use the new CreateClientAsync methods of IWorkflowRuntime instead.")]
public class StartWorkflowRuntimeParams
{
public string? CorrelationId { get; set; }

View file

@ -3,6 +3,7 @@ namespace Elsa.Workflows.Runtime.Params;
/// <summary>
/// Options for delivering a workflow inbox message.
/// </summary>
[Obsolete("This type is obsolete. Use the new IBookmarkQueue service instead.")]
public class WorkflowInboxMessageDeliveryParams
{
/// <summary>

View file

@ -3,6 +3,7 @@ namespace Elsa.Workflows.Runtime.Requests;
/// <summary>
/// Contains arguments to use for counting the number of workflow instances.
/// </summary>
[Obsolete("This type is obsolete. Use the new CreateClientAsync methods of IWorkflowRuntime instead.")]
public class CountRunningWorkflowsRequest
{
/// <summary>

View file

@ -5,4 +5,5 @@ namespace Elsa.Workflows.Runtime.Results;
/// </summary>
/// <param name="Success">True if the operation was successful; otherwise, false.</param>
/// <param name="Reason">The reason for the failure, if any.</param>
public record CancellationResult(bool Success, CancellationFailureReason? Reason = default);
[Obsolete("This type is obsolete. Use the new CreateClientAsync methods of IWorkflowRuntime instead.")]
public record CancellationResult(bool Success, CancellationFailureReason? Reason = null);

View file

@ -1,4 +1,3 @@
using Elsa.Workflows.Runtime.Deprecated;
using Elsa.Workflows.Runtime.Entities;
using Elsa.Workflows.Runtime.Filters;
using Elsa.Workflows.Runtime.Matches;

View file

@ -1,4 +1,3 @@
using Elsa.Workflows.Runtime.Deprecated;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Workflows.Runtime;

View file

@ -14,8 +14,11 @@ using Elsa.Workflows.Runtime.Results;
using Elsa.Workflows.State;
using Open.Linq.AsyncExtensions;
namespace Elsa.Workflows.Runtime.Deprecated;
namespace Elsa.Workflows.Runtime;
/// <summary>
/// Implements the now deprecated workflow runtime API methods.
/// </summary>
public class ObsoleteWorkflowRuntime(
Func<string?, CancellationToken, ValueTask<IWorkflowClient>> createClientAsync,
IWorkflowDefinitionService workflowDefinitionService,