elsa-core/src/modules/Elsa.Workflows.Runtime/Entities/BookmarkQueueDeadLetterItem.cs
Sipke Schoorstra 96b5ee80b5
Add bookmark queue dead-letter store (#7516)
* Add bookmark queue dead-letter store

* Make bookmark dead-letter replay atomic

* Address bookmark dead-letter review feedback

* Restore dead-letter replay state on enqueue failure

* Preserve replay rollback during cancellation

* Address bookmark dead-letter review threads

* Fix Oracle runtime migration snapshot drift

* Address bookmark dead-letter review feedback

* Make bookmark dead-lettering idempotent

* Detach memory dead-letter store snapshots

* Address bookmark dead-letter review fixes

* Harden bookmark dead-letter replay responses

* Preserve failed dead-letter replay during purge

* Clarify workflow runtime store list

* Address bookmark dead-letter review feedback

* Refine bookmark dead-letter purge races
2026-05-21 23:43:36 +02:00

101 lines
3 KiB
C#

using Elsa.Common.Entities;
using Elsa.Workflows.Runtime.Options;
namespace Elsa.Workflows.Runtime.Entities;
/// <summary>
/// Represents a bookmark queue item that was moved out of the active queue for operator inspection.
/// </summary>
public class BookmarkQueueDeadLetterItem : Entity
{
/// <summary>
/// The ID of the original bookmark queue item.
/// </summary>
public string OriginalQueueItemId { get; set; } = null!;
/// <summary>
/// The workflow instance ID owning the bookmark to resume.
/// </summary>
public string? WorkflowInstanceId { get; set; }
/// <summary>
/// The correlation ID associated with the workflow instance owning the bookmark to resume.
/// </summary>
public string? CorrelationId { get; set; }
/// <summary>
/// The bookmark ID to resume.
/// </summary>
public string? BookmarkId { get; set; }
/// <summary>
/// A bookmark payload hash of the bookmark to resume.
/// </summary>
public string? StimulusHash { get; set; }
/// <summary>
/// The ID of the activity instance associated with the bookmark.
/// </summary>
public string? ActivityInstanceId { get; set; }
/// <summary>
/// The type name of the activity associated with the bookmark.
/// </summary>
public string? ActivityTypeName { get; set; }
/// <summary>
/// Any options to apply when resuming the bookmark.
/// </summary>
public ResumeBookmarkOptions? Options { get; set; }
/// <summary>
/// The timestamp that the original queue item was created.
/// </summary>
public DateTimeOffset OriginalCreatedAt { get; set; }
/// <summary>
/// The timestamp that this item was moved to the dead-letter store.
/// </summary>
public DateTimeOffset DeadLetteredAt { get; set; }
/// <summary>
/// The reason this item was moved to the dead-letter store.
/// </summary>
public string Reason { get; set; } = null!;
/// <summary>
/// The number of failed delivery attempts observed before dead-lettering.
/// </summary>
public int DeliveryAttempts { get; set; }
/// <summary>
/// The timestamp of the last failed delivery attempt.
/// </summary>
public DateTimeOffset? LastAttemptedAt { get; set; }
/// <summary>
/// The type of the last exception observed while processing this item.
/// </summary>
public string? LastErrorType { get; set; }
/// <summary>
/// The message of the last exception observed while processing this item.
/// </summary>
public string? LastErrorMessage { get; set; }
/// <summary>
/// Whether this item can be replayed.
/// </summary>
public bool CanReplay { get; set; } = true;
/// <summary>
/// The timestamp that this item was replayed.
/// </summary>
public DateTimeOffset? ReplayedAt { get; set; }
/// <summary>
/// The ID of the queue item created when this dead-letter item was replayed.
/// </summary>
public string? ReplayedQueueItemId { get; set; }
}