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