Merge pull request #6377 from elsa-workflows/feature/incidents-main
Exposed incidents in the Elsa.Api.Client
This commit is contained in:
commit
8a309e64ea
|
|
@ -0,0 +1,51 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Holds information about an activity incident.
|
||||
/// </summary>
|
||||
public class ActivityIncident
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityIncident"/> class.
|
||||
/// </summary>
|
||||
[JsonConstructor]
|
||||
public ActivityIncident()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityIncident"/> class.
|
||||
/// </summary>
|
||||
/// <param name="activityId">The ID of the activity that caused the incident.</param>
|
||||
/// <param name="activityType">The type of the activity that caused the incident.</param>
|
||||
/// <param name="message">The message of the incident.</param>
|
||||
/// <param name="exception">The exception that caused the incident.</param>
|
||||
/// <param name="timestamp">The timestamp of the incident.</param>
|
||||
public ActivityIncident(string activityId, string activityType, string message, ExceptionState? exception, DateTimeOffset timestamp)
|
||||
{
|
||||
ActivityId = activityId;
|
||||
ActivityType = activityType;
|
||||
Message = message;
|
||||
Exception = exception;
|
||||
Timestamp = timestamp;
|
||||
}
|
||||
|
||||
/// <summary>The ID of the activity that caused the incident.</summary>
|
||||
public string ActivityId { get; init; } = default!;
|
||||
|
||||
/// <summary>The type of the activity that caused the incident.</summary>
|
||||
public string ActivityType { get; init; } = default!;
|
||||
|
||||
/// <summary>The message of the incident.</summary>
|
||||
public string Message { get; init; } = default!;
|
||||
|
||||
/// <summary>The exception that caused the incident.</summary>
|
||||
public ExceptionState? Exception { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The timestamp of the incident.
|
||||
/// </summary>
|
||||
public DateTimeOffset Timestamp { get; init; }
|
||||
}
|
||||
|
|
@ -38,6 +38,11 @@ public class WorkflowState : Entity
|
|||
/// </summary>
|
||||
public ICollection<Bookmark> Bookmarks { get; set; } = new List<Bookmark>();
|
||||
|
||||
/// <summary>
|
||||
/// A collection of incidents that may have occurred during execution.
|
||||
/// </summary>
|
||||
public ICollection<ActivityIncident> Incidents { get; set; } = new List<ActivityIncident>();
|
||||
|
||||
/// <summary>
|
||||
/// The serialized workflow state, if any.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue