| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Api.Client.Resources.WorkflowInstances.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Holds information about an activity incident. |
| | | 7 | | /// </summary> |
| | | 8 | | public class ActivityIncident |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Initializes a new instance of the <see cref="ActivityIncident"/> class. |
| | | 12 | | /// </summary> |
| | | 13 | | [JsonConstructor] |
| | 0 | 14 | | public ActivityIncident() |
| | | 15 | | { |
| | 0 | 16 | | } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Initializes a new instance of the <see cref="ActivityIncident"/> class. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <param name="activityId">The ID of the activity that caused the incident.</param> |
| | | 22 | | /// <param name="activityNodeId">The Node ID of the activity that caused the incident.</param> |
| | | 23 | | /// <param name="activityType">The type of the activity that caused the incident.</param> |
| | | 24 | | /// <param name="message">The message of the incident.</param> |
| | | 25 | | /// <param name="exception">The exception that caused the incident.</param> |
| | | 26 | | /// <param name="timestamp">The timestamp of the incident.</param> |
| | 0 | 27 | | public ActivityIncident(string activityId, string activityNodeId, string activityType, string message, ExceptionStat |
| | | 28 | | { |
| | 0 | 29 | | ActivityId = activityId; |
| | 0 | 30 | | ActivityNodeId = activityNodeId; |
| | 0 | 31 | | ActivityType = activityType; |
| | 0 | 32 | | Message = message; |
| | 0 | 33 | | Exception = exception; |
| | 0 | 34 | | Timestamp = timestamp; |
| | 0 | 35 | | } |
| | | 36 | | |
| | | 37 | | /// <summary>The ID of the activity that caused the incident.</summary> |
| | 0 | 38 | | public string ActivityId { get; init; } = default!; |
| | | 39 | | |
| | | 40 | | /// <summary>The Node ID of the activity that caused the incident.</summary> |
| | 0 | 41 | | public string ActivityNodeId { get; init; } = default!; |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// The ID of the individual activity execution that caused the incident. |
| | | 45 | | /// </summary> |
| | | 46 | | /// <remarks> |
| | | 47 | | /// <see cref="ActivityNodeId"/> identifies the static workflow node, which several executions can share when a node |
| | | 48 | | /// is looped, retried or run concurrently. This tells those executions apart. Null for an incident raised outside a |
| | | 49 | | /// activity execution, and for incidents persisted before the server recorded it. |
| | | 50 | | /// </remarks> |
| | 0 | 51 | | public string? ActivityInstanceId { get; init; } |
| | | 52 | | |
| | | 53 | | /// <summary>The type of the activity that caused the incident.</summary> |
| | 0 | 54 | | public string ActivityType { get; init; } = default!; |
| | | 55 | | |
| | | 56 | | /// <summary>The message of the incident.</summary> |
| | 0 | 57 | | public string Message { get; init; } = default!; |
| | | 58 | | |
| | | 59 | | /// <summary>The exception that caused the incident.</summary> |
| | 0 | 60 | | public ExceptionState? Exception { get; init; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// The timestamp of the incident. |
| | | 64 | | /// </summary> |
| | 0 | 65 | | public DateTimeOffset Timestamp { get; init; } |
| | | 66 | | } |