| | | 1 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 2 | | using Elsa.Workflows.Models; |
| | | 3 | | |
| | | 4 | | namespace Elsa.Workflows.State; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Represents the current state of a workflow. |
| | | 8 | | /// </summary> |
| | | 9 | | public class WorkflowState |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Gets or sets the ID. |
| | | 13 | | /// </summary> |
| | 1811 | 14 | | public string Id { get; set; } = null!; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// The workflow definition ID. |
| | | 18 | | /// </summary> |
| | 1513 | 19 | | public string DefinitionId { get; set; } = null!; |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// The workflow definition version ID. |
| | | 23 | | /// </summary> |
| | 1514 | 24 | | public string DefinitionVersionId { get; set; } = null!; |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// The workflow definition version. |
| | | 28 | | /// </summary> |
| | 1513 | 29 | | public int DefinitionVersion { get; set; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// The ID of the parent workflow. |
| | | 33 | | /// </summary> |
| | 1540 | 34 | | public string? ParentWorkflowInstanceId { get; set; } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// The correlation ID of the workflow, if any. |
| | | 38 | | /// </summary> |
| | 1664 | 39 | | public string? CorrelationId { get; set; } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Gets or sets the name of the workflow instance. |
| | | 43 | | /// </summary> |
| | 1537 | 44 | | public string? Name { get; set; } |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// The status of the workflow. |
| | | 48 | | /// </summary> |
| | 3426 | 49 | | public WorkflowStatus Status { get; set; } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// The sub status of the workflow. |
| | | 53 | | /// </summary> |
| | 1813 | 54 | | public WorkflowSubStatus SubStatus { get; set; } |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// Gets or sets a value indicating whether the workflow instance is actively executing. |
| | | 58 | | /// </summary> |
| | 1469 | 59 | | public bool IsExecuting { get; set; } |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// Collected bookmarks. |
| | | 63 | | /// </summary> |
| | | 64 | | [NotMapped] |
| | 1951 | 65 | | public ICollection<Bookmark> Bookmarks { get; set; } = new List<Bookmark>(); |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// A collection of incidents that may have occurred during execution. |
| | | 69 | | /// </summary> |
| | 2531 | 70 | | public ICollection<ActivityIncident> Incidents { get; set; } = new List<ActivityIncident>(); |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Gets or sets the value indicating whether the workflow is a system workflow. |
| | | 74 | | /// </summary> |
| | 1513 | 75 | | public bool IsSystem { get; set; } |
| | | 76 | | |
| | | 77 | | /// <summary> |
| | | 78 | | /// A list of callbacks that activities registered in order to be notified when the activities they scheduled comple |
| | | 79 | | /// </summary> |
| | 1670 | 80 | | public ICollection<CompletionCallbackState> CompletionCallbacks { get; set; } = new List<CompletionCallbackState>(); |
| | | 81 | | |
| | | 82 | | /// <summary> |
| | | 83 | | /// A flattened list of <see cref="ActivityExecutionContextState"/> objects, representing the various active "call s |
| | | 84 | | /// </summary> |
| | | 85 | | [NotMapped] |
| | 1805 | 86 | | public ICollection<ActivityExecutionContextState> ActivityExecutionContexts { get; set; } = new List<ActivityExecuti |
| | | 87 | | |
| | | 88 | | /// <summary> |
| | | 89 | | /// A list of scheduled activities. |
| | | 90 | | /// </summary> |
| | 1670 | 91 | | public ICollection<ActivityWorkItemState> ScheduledActivities { get; set; } = new List<ActivityWorkItemState>(); |
| | | 92 | | |
| | | 93 | | /// <summary> |
| | | 94 | | /// The current execution log sequence number. |
| | | 95 | | /// </summary> |
| | 1029 | 96 | | public long ExecutionLogSequence { get; set; } |
| | | 97 | | |
| | | 98 | | /// <summary> |
| | | 99 | | /// A dictionary of inputs sent to the workflow. |
| | | 100 | | /// </summary> |
| | 1755 | 101 | | public IDictionary<string, object> Input { get; set; } = new Dictionary<string, object>(); |
| | | 102 | | |
| | | 103 | | /// <summary> |
| | | 104 | | /// A dictionary of outputs produced by the workflow. |
| | | 105 | | /// </summary> |
| | 1748 | 106 | | public IDictionary<string, object> Output { get; set; } = new Dictionary<string, object>(); |
| | | 107 | | |
| | | 108 | | /// <summary> |
| | | 109 | | /// A global property bag that contains properties set by application code and/or activities. |
| | | 110 | | /// </summary> |
| | 3386 | 111 | | public IDictionary<string, object> Properties { get; set; } = new Dictionary<string, object>(); |
| | | 112 | | |
| | | 113 | | /// <summary> |
| | | 114 | | /// The created time of the workflow. |
| | | 115 | | /// </summary> |
| | 1765 | 116 | | public DateTimeOffset CreatedAt { get; set; } |
| | | 117 | | |
| | | 118 | | /// <summary> |
| | | 119 | | /// The last updated time of the workflow. |
| | | 120 | | /// </summary> |
| | 1639 | 121 | | public DateTimeOffset UpdatedAt { get; set; } |
| | | 122 | | |
| | | 123 | | /// <summary> |
| | | 124 | | /// The finished time of the workflow. |
| | | 125 | | /// </summary> |
| | 1486 | 126 | | public DateTimeOffset? FinishedAt { get; set; } |
| | | 127 | | } |