< Summary

Information
Class: Elsa.Workflows.Runtime.WorkflowInterruptedPayload
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Models/Payloads/WorkflowInterruptedPayload.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 35
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_InterruptedAt()100%11100%
get_Reason()100%11100%
get_GenerationId()100%11100%
get_LastActivityId()100%11100%
get_LastActivityNodeId()100%11100%
get_IngressSourceName()100%11100%
get_ExecutionCycleDuration()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Models/Payloads/WorkflowInterruptedPayload.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2
 3namespace Elsa.Workflows.Runtime;
 4
 5/// <summary>
 6/// Typed payload recorded in the per-instance workflow execution log whenever an execution cycle is force-cancelled
 7/// by the runtime. Stored under <see cref="WorkflowInterruptedEventName"/>.
 8/// </summary>
 9/// <remarks>
 10/// The <see cref="ExecutionCycleDuration"/> property is serialized under the JSON key <c>"BurstDuration"</c> for
 11/// backwards compatibility — that key was already present in records persisted by pre-merge testers of this PR
 12/// before the execution cycle → execution-cycle rename, and we preserve it so existing rows continue to deserialize. Th
 13/// property name uses the new vocabulary; the wire format keeps the old one.
 14/// </remarks>
 815public sealed record WorkflowInterruptedPayload(
 616    DateTimeOffset InterruptedAt,
 817    string Reason,
 318    string GenerationId,
 1019    string? LastActivityId,
 620    string? LastActivityNodeId,
 421    string? IngressSourceName,
 1122    [property: JsonPropertyName("BurstDuration")] TimeSpan ExecutionCycleDuration)
 23{
 24    /// <summary>Stable event name used on <c>WorkflowExecutionLogRecord.EventName</c>.</summary>
 25    public const string WorkflowInterruptedEventName = "WorkflowInterrupted";
 26
 27    /// <summary>Reason discriminator: a drain deadline elapsed while execution cycles were still running.</summary>
 28    public const string ReasonDeadlineBreach = "DeadlineBreach";
 29
 30    /// <summary>Reason discriminator: an operator invoked the admin force-drain endpoint.</summary>
 31    public const string ReasonOperatorForce = "OperatorForce";
 32
 33    /// <summary>Reason discriminator: the persistence layer was unavailable when the drain tried to commit the cycle's 
 34    public const string ReasonPersistenceFailure = "PersistenceFailure";
 35}