< Summary

Information
Class: Elsa.Workflows.State.CompletionCallbackState
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/State/CompletionCallbackState.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 56
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%
.ctor(...)100%11100%
get_OwnerInstanceId()100%11100%
get_ChildNodeId()100%11100%
get_MethodName()100%11100%
get_Tag()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/State/CompletionCallbackState.cs

#LineLine coverage
 1// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
 2// Required for JSON serialization configured with reference handling.
 3namespace Elsa.Workflows.State;
 4
 5// Can't use records when using System.Text.Json serialization and reference handling. Hence, using a class with default
 6//public record CompletionCallbackState(string OwnerId, string ChildId, string MethodName);
 7
 8/// <summary>
 9/// Represents a serializable completion callback that is registered by an activity.
 10/// </summary>
 11public class CompletionCallbackState
 12{
 13    // ReSharper disable once UnusedMember.Global
 14    // Required for JSON serialization configured with reference handling.
 15    /// <summary>
 16    /// Creates a new instance of the <see cref="CompletionCallbackState"/> class.
 17    /// </summary>
 11618    public CompletionCallbackState()
 19    {
 11620    }
 21
 22    /// <summary>
 23    /// Creates a new instance of the <see cref="CompletionCallbackState"/> class.
 24    /// </summary>
 25    /// <param name="ownerInstanceId">The ID of the activity instance that registered the callback.</param>
 26    /// <param name="childNodeId">The ID of the child node that the callback is registered for.</param>
 27    /// <param name="methodName">The name of the method to invoke when the child node completes.</param>
 28    /// <param name="tag">An optional tag.</param>
 12629    public CompletionCallbackState(string ownerInstanceId, string childNodeId, string? methodName, object? tag = default
 30    {
 12631        OwnerInstanceId = ownerInstanceId;
 12632        ChildNodeId = childNodeId;
 12633        MethodName = methodName;
 12634        Tag = tag;
 12635    }
 36
 37    /// <summary>
 38    /// Gets the ID of the activity instance that registered the callback.
 39    /// </summary>
 60940    public string OwnerInstanceId { get; init; } = default!;
 41
 42    /// <summary>
 43    /// Gets the ID of the child node that the callback is registered for.
 44    /// </summary>
 44445    public string ChildNodeId { get; init; } = default!;
 46
 47    /// <summary>
 48    /// Gets the name of the method to invoke when the child node completes.
 49    /// </summary>
 44450    public string? MethodName { get; init; }
 51
 52    /// <summary>
 53    /// Gets the tag.
 54    /// </summary>
 32855    public object? Tag { get; init; }
 56}