< Summary

Information
Class: Elsa.Workflows.Runtime.RuntimeAdminStatus
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Contracts/IWorkflowRuntimeAdminService.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 40
Line coverage: 0%
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%210%
get_State()100%210%
get_Sources()100%210%
get_ActiveExecutionCycleCount()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Contracts/IWorkflowRuntimeAdminService.cs

#LineLine coverage
 1namespace Elsa.Workflows.Runtime;
 2
 3/// <summary>
 4/// Domain service that backs the runtime's administrative pause / resume / force-drain / status surface. Endpoints
 5/// (HTTP, MCP, CLI) compose this single service rather than re-implementing the orchestration + audit logic per
 6/// transport.
 7/// </summary>
 8public interface IWorkflowRuntimeAdminService
 9{
 10    /// <summary>
 11    /// Places the runtime into <see cref="QuiescenceReason.AdministrativePause"/>. Idempotent — a second call with
 12    /// the runtime already paused returns the current state without publishing additional audit notifications
 13    /// (SC-007).
 14    /// </summary>
 15    ValueTask<QuiescenceState> PauseAsync(string? reason, string? requestedBy, CancellationToken cancellationToken);
 16
 17    /// <summary>
 18    /// Clears <see cref="QuiescenceReason.AdministrativePause"/>. Returns the post-request state regardless of the
 19    /// outcome — callers detect "resume rejected because drain is active" by inspecting
 20    /// <see cref="QuiescenceState.Reason"/> against the original state.
 21    /// </summary>
 22    ValueTask<QuiescenceState> ResumeAsync(string? requestedBy, CancellationToken cancellationToken);
 23
 24    /// <summary>
 25    /// Operator-escalation drain with zero deadline. Cancels every active execution cycle, persists their instances as
 26    /// <see cref="WorkflowSubStatus.Interrupted"/>, writes a <c>WorkflowInterrupted</c> log entry per affected
 27    /// instance, and returns the structured outcome. Throws <see cref="InvalidOperationException"/> when a
 28    /// non-force drain is already in progress in the same generation.
 29    /// </summary>
 30    ValueTask<DrainOutcome> ForceDrainAsync(string? reason, string? requestedBy, CancellationToken cancellationToken);
 31
 32    /// <summary>Composite status for the admin status endpoint and any other diagnostic consumer.</summary>
 33    RuntimeAdminStatus GetStatus();
 34}
 35
 36/// <summary>Snapshot returned by <see cref="IWorkflowRuntimeAdminService.GetStatus"/>.</summary>
 037public sealed record RuntimeAdminStatus(
 038    QuiescenceState State,
 039    IReadOnlyCollection<IngressSourceSnapshot> Sources,
 040    int ActiveExecutionCycleCount);