| | | 1 | | using Elsa.Common.Models; |
| | | 2 | | using Elsa.Workflows.Activities; |
| | | 3 | | using Elsa.Workflows.Management.Entities; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Workflows.Management; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Extension methods for <see cref="IWorkflowDefinitionService"/>. |
| | | 9 | | /// </summary> |
| | | 10 | | public static class WorkflowDefinitionServiceExtensions |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Looks for a <see cref="WorkflowDefinition"/> by the specified definition ID and <see cref="VersionOptions"/>. |
| | | 14 | | /// </summary> |
| | | 15 | | public static Task<WorkflowDefinition?> FindWorkflowDefinitionAsync(this IWorkflowDefinitionService service, string |
| | | 16 | | { |
| | 0 | 17 | | return service.FindWorkflowDefinitionAsync(definitionId, versionOptions, cancellationToken: cancellationToken); |
| | | 18 | | } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Looks for a <see cref="WorkflowDefinition"/> by the specified version ID. |
| | | 22 | | /// </summary> |
| | | 23 | | public static Task<WorkflowDefinition?> FindWorkflowDefinitionAsync(this IWorkflowDefinitionService service, string |
| | | 24 | | { |
| | 0 | 25 | | return service.FindWorkflowDefinitionAsync(definitionVersionId, cancellationToken: cancellationToken); |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Looks for a <see cref="Workflow"/> by the specified definition ID and <see cref="VersionOptions"/>. |
| | | 30 | | /// </summary> |
| | | 31 | | public static async Task<Workflow?> FindWorkflowAsync(this IWorkflowDefinitionService service, string definitionId, |
| | | 32 | | { |
| | 0 | 33 | | return (await service.FindWorkflowGraphAsync(definitionId, versionOptions, cancellationToken: cancellationToken) |
| | 0 | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Looks for a <see cref="Workflow"/> by the specified version ID. |
| | | 38 | | /// </summary> |
| | | 39 | | public static async Task<Workflow?> FindWorkflowAsync(this IWorkflowDefinitionService service, string definitionVers |
| | | 40 | | { |
| | 0 | 41 | | return (await service.FindWorkflowGraphAsync(definitionVersionId, cancellationToken: cancellationToken))?.Workfl |
| | 0 | 42 | | } |
| | | 43 | | } |