diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ActivityIncident.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ActivityIncident.cs new file mode 100644 index 0000000000..0782750081 --- /dev/null +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ActivityIncident.cs @@ -0,0 +1,51 @@ +using System.Text.Json.Serialization; + +namespace Elsa.Api.Client.Resources.WorkflowInstances.Models; + +/// +/// Holds information about an activity incident. +/// +public class ActivityIncident +{ + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + public ActivityIncident() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The ID of the activity that caused the incident. + /// The type of the activity that caused the incident. + /// The message of the incident. + /// The exception that caused the incident. + /// The timestamp of the incident. + public ActivityIncident(string activityId, string activityType, string message, ExceptionState? exception, DateTimeOffset timestamp) + { + ActivityId = activityId; + ActivityType = activityType; + Message = message; + Exception = exception; + Timestamp = timestamp; + } + + /// The ID of the activity that caused the incident. + public string ActivityId { get; init; } = default!; + + /// The type of the activity that caused the incident. + public string ActivityType { get; init; } = default!; + + /// The message of the incident. + public string Message { get; init; } = default!; + + /// The exception that caused the incident. + public ExceptionState? Exception { get; init; } + + /// + /// The timestamp of the incident. + /// + public DateTimeOffset Timestamp { get; init; } +} diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowState.cs index 1a7c2a7b43..48f1391d80 100644 --- a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowState.cs +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowState.cs @@ -38,6 +38,11 @@ public class WorkflowState : Entity /// public ICollection Bookmarks { get; set; } = new List(); + /// + /// A collection of incidents that may have occurred during execution. + /// + public ICollection Incidents { get; set; } = new List(); + /// /// The serialized workflow state, if any. ///