| | | 1 | | using Elsa.Workflows.State; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Api.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a workflow instance. |
| | | 7 | | /// </summary> |
| | | 8 | | public class WorkflowInstanceModel |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Gets or sets the ID of the workflow instance. |
| | | 12 | | /// </summary> |
| | 0 | 13 | | public string Id { get; set; } = default!; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// The ID of the workflow definition. |
| | | 17 | | /// </summary> |
| | 0 | 18 | | public string DefinitionId { get; set; } = default!; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// The version ID of the workflow definition. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public string DefinitionVersionId { get; set; } = default!; |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// The version of the workflow definition. |
| | | 27 | | /// </summary> |
| | 0 | 28 | | public int Version { get; set; } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// The ID of the parent workflow instance. |
| | | 32 | | /// </summary> |
| | 0 | 33 | | public string? ParentWorkflowInstanceId { get; set; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// The state of the workflow instance. |
| | | 37 | | /// </summary> |
| | 0 | 38 | | public WorkflowState WorkflowState { get; set; } = default!; |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// The status of the workflow instance. |
| | | 42 | | /// </summary> |
| | 0 | 43 | | public WorkflowStatus Status { get; set; } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// The sub-status of the workflow instance. |
| | | 47 | | /// </summary> |
| | 0 | 48 | | public WorkflowSubStatus SubStatus { get; set; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Gets or sets a value indicating whether the workflow instance is actively executing. |
| | | 52 | | /// </summary> |
| | | 53 | | /// <remarks> |
| | | 54 | | /// This flag is set to <c>true</c> immediately before the workflow begins execution |
| | | 55 | | /// and is set to <c>false</c> once the execution is completed. |
| | | 56 | | /// It can be used to determine if a workflow instance was in-progress in case of unexpected |
| | | 57 | | /// application termination, allowing the system to retry execution upon restarting. |
| | | 58 | | /// </remarks> |
| | 0 | 59 | | public bool IsExecuting { get; set; } |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// The ID of the workflow instance. |
| | | 63 | | /// </summary> |
| | 0 | 64 | | public string? CorrelationId { get; set; } |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// The name of the workflow instance. |
| | | 68 | | /// </summary> |
| | 0 | 69 | | public string? Name { get; set; } |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// The number of incidents that have occurred during execution, if any. |
| | | 73 | | /// </summary> |
| | 0 | 74 | | public int IncidentCount { get; set; } |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// Gets or sets whether the workflow instance is a system workflow. |
| | | 78 | | /// </summary> |
| | 0 | 79 | | public bool IsSystem { get; set; } |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// The timestamp when the workflow instance was created. |
| | | 83 | | /// </summary> |
| | 0 | 84 | | public DateTimeOffset CreatedAt { get; set; } |
| | | 85 | | |
| | | 86 | | /// <summary> |
| | | 87 | | /// The timestamp when the workflow instance was last executed. |
| | | 88 | | /// </summary> |
| | 0 | 89 | | public DateTimeOffset UpdatedAt { get; set; } |
| | | 90 | | |
| | | 91 | | /// <summary> |
| | | 92 | | /// The timestamp when the workflow instance was finished. |
| | | 93 | | /// </summary> |
| | 0 | 94 | | public DateTimeOffset? FinishedAt { get; set; } |
| | | 95 | | } |