| | | 1 | | using Elsa.Api.Client.Shared.Models; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Api.Client.Resources.ActivityExecutions.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a summarized view of a single activity execution of an activity instance. |
| | | 7 | | /// </summary> |
| | | 8 | | public class ActivityExecutionRecordSummary : Entity |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Gets or sets the workflow instance ID. |
| | | 12 | | /// </summary> |
| | 0 | 13 | | public string WorkflowInstanceId { get; set; } = null!; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Gets or sets the activity ID. |
| | | 17 | | /// </summary> |
| | 0 | 18 | | public string ActivityId { get; set; } = null!; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Gets or sets the activity node ID. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public string ActivityNodeId { get; set; } = null!; |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// The type of the activity. |
| | | 27 | | /// </summary> |
| | 0 | 28 | | public string ActivityType { get; set; } = null!; |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// The version of the activity type. |
| | | 32 | | /// </summary> |
| | 0 | 33 | | public int ActivityTypeVersion { get; set; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// The name of the activity. |
| | | 37 | | /// </summary> |
| | 0 | 38 | | public string? ActivityName { get; set; } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Gets or sets the time at which the activity execution began. |
| | | 42 | | /// </summary> |
| | 0 | 43 | | public DateTimeOffset StartedAt { get; set; } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// Gets or sets whether the activity has any bookmarks. |
| | | 47 | | /// </summary> |
| | 0 | 48 | | public bool HasBookmarks { get; set; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Gets or sets metadata for the activity execution. |
| | | 52 | | /// </summary> |
| | 0 | 53 | | public IDictionary<string, object?>? Metadata { get; set; } |
| | | 54 | | |
| | | 55 | | /// <summary> |
| | | 56 | | /// Gets or sets the status of the activity. |
| | | 57 | | /// </summary> |
| | 0 | 58 | | public ActivityStatus Status { get; set; } |
| | | 59 | | |
| | | 60 | | /// <summary> |
| | | 61 | | /// Gets or sets the time at which the activity execution completed. |
| | | 62 | | /// </summary> |
| | 0 | 63 | | public DateTimeOffset? CompletedAt { get; set; } |
| | | 64 | | |
| | | 65 | | /// <summary> |
| | | 66 | | /// Returns a summary view of the specified <see cref="ActivityExecutionRecord"/>. |
| | | 67 | | /// </summary> |
| | | 68 | | public static ActivityExecutionRecordSummary FromRecord(ActivityExecutionRecord record) |
| | | 69 | | { |
| | 0 | 70 | | return new() |
| | 0 | 71 | | { |
| | 0 | 72 | | Id = record.Id, |
| | 0 | 73 | | WorkflowInstanceId = record.WorkflowInstanceId, |
| | 0 | 74 | | ActivityId = record.ActivityId, |
| | 0 | 75 | | ActivityNodeId = record.ActivityNodeId, |
| | 0 | 76 | | ActivityType = record.ActivityType, |
| | 0 | 77 | | ActivityTypeVersion = record.ActivityTypeVersion, |
| | 0 | 78 | | ActivityName = record.ActivityName, |
| | 0 | 79 | | StartedAt = record.StartedAt, |
| | 0 | 80 | | HasBookmarks = record.HasBookmarks, |
| | 0 | 81 | | Status = record.Status, |
| | 0 | 82 | | CompletedAt = record.CompletedAt, |
| | 0 | 83 | | Metadata = record.Metadata |
| | 0 | 84 | | }; |
| | | 85 | | } |
| | | 86 | | } |