| | | 1 | | using System.Linq.Expressions; |
| | | 2 | | using Elsa.Workflows.Management.Entities; |
| | | 3 | | using JetBrains.Annotations; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Workflows.Management.Models; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// A summary of a workflow definition. |
| | | 9 | | /// </summary> |
| | | 10 | | [PublicAPI] |
| | | 11 | | public class WorkflowDefinitionSummary |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Creates a new instance of the <see cref="WorkflowDefinitionSummary"/> class from the specified <see cref="Workfl |
| | | 15 | | /// </summary> |
| | 0 | 16 | | public static WorkflowDefinitionSummary FromDefinition(WorkflowDefinition workflowDefinition) => new() |
| | 0 | 17 | | { |
| | 0 | 18 | | Id = workflowDefinition.Id, |
| | 0 | 19 | | DefinitionId = workflowDefinition.DefinitionId, |
| | 0 | 20 | | Name = workflowDefinition.Name, |
| | 0 | 21 | | Description = workflowDefinition.Description, |
| | 0 | 22 | | Version = workflowDefinition.Version, |
| | 0 | 23 | | ToolVersion = workflowDefinition.ToolVersion, |
| | 0 | 24 | | IsLatest = workflowDefinition.IsLatest, |
| | 0 | 25 | | IsPublished = workflowDefinition.IsPublished, |
| | 0 | 26 | | ProviderName = workflowDefinition.ProviderName, |
| | 0 | 27 | | MaterializerName = workflowDefinition.MaterializerName, |
| | 0 | 28 | | CreatedAt = workflowDefinition.CreatedAt, |
| | 0 | 29 | | IsReadonly = workflowDefinition.IsReadonly |
| | 0 | 30 | | }; |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Creates a new instance of the <see cref="WorkflowDefinitionSummary"/> class from the specified <see cref="Workfl |
| | | 34 | | /// </summary> |
| | 2 | 35 | | public static Expression<Func<WorkflowDefinition, WorkflowDefinitionSummary>> FromDefinitionExpression() => workflow |
| | 2 | 36 | | { |
| | 2 | 37 | | Id = workflowDefinition.Id, |
| | 2 | 38 | | DefinitionId = workflowDefinition.DefinitionId, |
| | 2 | 39 | | Name = workflowDefinition.Name, |
| | 2 | 40 | | Description = workflowDefinition.Description, |
| | 2 | 41 | | Version = workflowDefinition.Version, |
| | 2 | 42 | | ToolVersion = workflowDefinition.ToolVersion, |
| | 2 | 43 | | IsLatest = workflowDefinition.IsLatest, |
| | 2 | 44 | | IsPublished = workflowDefinition.IsPublished, |
| | 2 | 45 | | ProviderName = workflowDefinition.ProviderName, |
| | 2 | 46 | | MaterializerName = workflowDefinition.MaterializerName, |
| | 2 | 47 | | CreatedAt = workflowDefinition.CreatedAt, |
| | 2 | 48 | | IsReadonly = workflowDefinition.IsReadonly |
| | 2 | 49 | | }; |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// The version ID of the workflow definition. |
| | | 53 | | /// </summary> |
| | 368 | 54 | | public string Id { get; set; } = null!; |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// The ID of the workflow definition. |
| | | 58 | | /// </summary> |
| | 369 | 59 | | public string DefinitionId { get; set; } = null!; |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// The name of the workflow definition. |
| | | 63 | | /// </summary> |
| | 148 | 64 | | public string? Name { get; set; } |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// The description of the workflow definition. |
| | | 68 | | /// </summary> |
| | 148 | 69 | | public string? Description { get; set; } |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// The version of the workflow definition. |
| | | 73 | | /// </summary> |
| | 369 | 74 | | public int? Version { get; set; } |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// The version of the tool that created the workflow definition. |
| | | 78 | | /// </summary> |
| | 148 | 79 | | public Version? ToolVersion { get; set; } |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// Whether this is the latest version of the workflow definition. |
| | | 83 | | /// </summary> |
| | 148 | 84 | | public bool IsLatest { get; set; } |
| | | 85 | | |
| | | 86 | | /// <summary> |
| | | 87 | | /// Whether this workflow definition is published. |
| | | 88 | | /// </summary> |
| | 148 | 89 | | public bool IsPublished { get; set; } |
| | | 90 | | |
| | | 91 | | /// <summary> |
| | | 92 | | /// The provider name of the workflow definition. |
| | | 93 | | /// </summary> |
| | 148 | 94 | | public string? ProviderName { get; set; } |
| | | 95 | | |
| | | 96 | | /// <summary> |
| | | 97 | | /// The materializer name of the workflow definition. |
| | | 98 | | /// </summary> |
| | 148 | 99 | | public string MaterializerName { get; set; } = null!; |
| | | 100 | | |
| | | 101 | | /// <summary> |
| | | 102 | | /// The timestamp when the workflow definition was created. |
| | | 103 | | /// </summary> |
| | 148 | 104 | | public DateTimeOffset CreatedAt { get; set; } |
| | | 105 | | |
| | | 106 | | /// <summary> |
| | | 107 | | /// Makes workflow |
| | | 108 | | /// </summary> |
| | 148 | 109 | | public bool IsReadonly { get; set; } |
| | | 110 | | } |