| | | 1 | | using Elsa.Api.Client.Resources.WorkflowInstances.Enums; |
| | | 2 | | using Elsa.Api.Client.Shared.Models; |
| | | 3 | | |
| | | 4 | | namespace Elsa.Api.Client.Resources.WorkflowInstances.Models; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Represents the current state of a workflow. |
| | | 8 | | /// </summary> |
| | | 9 | | public class WorkflowState : Entity |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// The workflow definition ID. |
| | | 13 | | /// </summary> |
| | 3 | 14 | | public string DefinitionId { get; set; } = default!; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// The workflow definition version. |
| | | 18 | | /// </summary> |
| | 3 | 19 | | public int DefinitionVersion { get; set; } |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// The correlation ID of the workflow, if any. |
| | | 23 | | /// </summary> |
| | 0 | 24 | | public string? CorrelationId { get; set; } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// The status of the workflow. |
| | | 28 | | /// </summary> |
| | 3 | 29 | | public WorkflowStatus Status { get; set; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// The sub status of the workflow. |
| | | 33 | | /// </summary> |
| | 3 | 34 | | public WorkflowSubStatus SubStatus { get; set; } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Collected bookmarks. |
| | | 38 | | /// </summary> |
| | 6 | 39 | | public ICollection<Bookmark> Bookmarks { get; set; } = new List<Bookmark>(); |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// A collection of incidents that may have occurred during execution. |
| | | 43 | | /// </summary> |
| | 6 | 44 | | public ICollection<ActivityIncident> Incidents { get; set; } = new List<ActivityIncident>(); |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// The serialized workflow state, if any. |
| | | 48 | | /// </summary> |
| | 0 | 49 | | public WorkflowFaultState? Fault { get; set; } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// A list of callbacks that activities registered in order to be notified when the activities they scheduled comple |
| | | 53 | | /// </summary> |
| | 6 | 54 | | public ICollection<CompletionCallbackState> CompletionCallbacks { get; set; } = new List<CompletionCallbackState>(); |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// A flattened list of <see cref="ActivityExecutionContextState"/> objects, representing the various active "call s |
| | | 58 | | /// </summary> |
| | 6 | 59 | | public ICollection<ActivityExecutionContextState> ActivityExecutionContexts { get; set; } = new List<ActivityExecuti |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// A dictionary of inputs sent to the workflow. |
| | | 63 | | /// </summary> |
| | 6 | 64 | | public IDictionary<string, object> Input { get; set; } = new Dictionary<string, object>(); |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// A dictionary of outputs produced by the workflow. |
| | | 68 | | /// </summary> |
| | 6 | 69 | | public IDictionary<string, object> Output { get; set; } = new Dictionary<string, object>(); |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// A global property bag that contains properties set by application code and/or activities. |
| | | 73 | | /// </summary> |
| | 6 | 74 | | public IDictionary<string, object> Properties { get; set; } = new Dictionary<string, object>(); |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// The created time of the workflow. |
| | | 78 | | /// </summary> |
| | 3 | 79 | | public DateTimeOffset CreatedAt { get; set; } |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// The last updated time of the workflow. |
| | | 83 | | /// </summary> |
| | 3 | 84 | | public DateTimeOffset UpdatedAt { get; set; } |
| | | 85 | | |
| | | 86 | | /// <summary> |
| | | 87 | | /// The finished time of the workflow. |
| | | 88 | | /// </summary> |
| | 3 | 89 | | public DateTimeOffset? FinishedAt { get; set; } |
| | | 90 | | } |