| | | 1 | | using Elsa.Common.Models; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a handle to a workflow definition. |
| | | 7 | | /// </summary> |
| | | 8 | | public class WorkflowDefinitionHandle |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Gets or sets the definition ID. When set, the <see cref="DefinitionVersionId"/> property is ignored. |
| | | 12 | | /// </summary> |
| | 552 | 13 | | public string? DefinitionId { get; set; } |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Gets or sets the version options. When set, the <see cref="DefinitionVersionId"/> property is ignored. |
| | | 17 | | /// </summary> |
| | 552 | 18 | | public VersionOptions? VersionOptions { get; set; } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Gets or sets the definition version ID. When set, the <see cref="DefinitionId"/> and <see cref="VersionOptions"/ |
| | | 22 | | /// </summary> |
| | 727 | 23 | | public string? DefinitionVersionId { get; set; } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Creates a new <see cref="WorkflowDefinitionHandle"/> instance with the specified definition ID and version optio |
| | | 27 | | /// </summary> |
| | 73 | 28 | | public static WorkflowDefinitionHandle ByDefinitionId(string definitionId, VersionOptions? versionOptions = null) => |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Creates a new <see cref="WorkflowDefinitionHandle"/> instance with the specified definition version ID. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="definitionVersionId"></param> |
| | | 34 | | /// <returns></returns> |
| | 248 | 35 | | public static WorkflowDefinitionHandle ByDefinitionVersionId(string definitionVersionId) => new() { DefinitionVersio |
| | | 36 | | |
| | | 37 | | /// <inheritdoc /> |
| | | 38 | | public override string ToString() |
| | | 39 | | { |
| | 0 | 40 | | if (DefinitionId != null) |
| | 0 | 41 | | return $"DefinitionId: {DefinitionId}, VersionOptions: {VersionOptions}"; |
| | | 42 | | |
| | 0 | 43 | | if (DefinitionVersionId != null) |
| | 0 | 44 | | return $"DefinitionVersionId: {DefinitionVersionId}"; |
| | | 45 | | |
| | 0 | 46 | | return string.Empty; |
| | | 47 | | } |
| | | 48 | | } |