< Summary

Information
Class: Elsa.Workflows.Models.ActivityIncident
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/ActivityIncident.cs
Line coverage
88%
Covered lines: 16
Uncovered lines: 2
Coverable lines: 18
Total lines: 72
Line coverage: 88.8%
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%
.ctor(...)100%11100%
get_ActivityId()100%11100%
get_ActivityNodeId()100%11100%
get_ActivityInstanceId()100%11100%
get_ActivityType()100%11100%
get_Message()100%11100%
get_Exception()100%11100%
get_Timestamp()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/ActivityIncident.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2using Elsa.Workflows.State;
 3
 4namespace Elsa.Workflows.Models;
 5
 6/// <summary>
 7/// Holds information about an activity incident.
 8/// </summary>
 9public class ActivityIncident
 10{
 11    /// <summary>
 12    /// Initializes a new instance of the <see cref="ActivityIncident"/> class.
 13    /// </summary>
 14    [JsonConstructor]
 015    public ActivityIncident()
 16    {
 017    }
 18
 19    /// <summary>
 20    /// Initializes a new instance of the <see cref="ActivityIncident"/> class.
 21    /// </summary>
 22    /// <param name="activityId">The ID of the activity that caused the incident.</param>
 23    /// <param name="activityNodeId">The Node ID of the activity that caused the incident.</param>
 24    /// <param name="activityType">The type of the activity that caused the incident.</param>
 25    /// <param name="message">The message of the incident.</param>
 26    /// <param name="exception">The exception that caused the incident.</param>
 27    /// <param name="timestamp">The timestamp of the incident.</param>
 28    /// <param name="activityInstanceId">The ID of the individual activity execution that caused the incident, if any.</
 3029    public ActivityIncident(string activityId, string activityNodeId, string activityType, string message, ExceptionStat
 30    {
 3031        ActivityId = activityId;
 3032        ActivityNodeId = activityNodeId;
 3033        ActivityType = activityType;
 3034        Message = message;
 3035        Exception = exception;
 3036        Timestamp = timestamp;
 3037        ActivityInstanceId = activityInstanceId;
 3038    }
 39
 40    /// <summary>The ID of the activity that caused the incident.</summary>
 3641    public string ActivityId { get; init; } = default!;
 42    /// <summary>The Node ID of the activity that caused the incident.</summary>
 3843    public string ActivityNodeId { get; init; } = default!;
 44
 45    /// <summary>
 46    /// The ID of the individual activity execution that caused the incident.
 47    /// </summary>
 48    /// <remarks>
 49    /// <see cref="ActivityNodeId"/> identifies the static workflow node, and several executions can share one: a node
 50    /// inside a loop, retried, or run concurrently raises an incident per execution, all carrying the same node id. Thi
 51    /// tells them apart, so an incident can be tied back to the execution that raised it.
 52    /// <para>
 53    /// Null for an incident raised outside an activity execution, such as one recorded against the workflow itself, and
 54    /// for incidents persisted before this property existed.
 55    /// </para>
 56    /// </remarks>
 4757    public string? ActivityInstanceId { get; init; }
 58
 59    /// <summary>The type of the activity that caused the incident.</summary>
 3660    public string ActivityType { get; init; } = default!;
 61
 62    /// <summary>The message of the incident.</summary>
 4263    public string Message { get; init; } = default!;
 64
 65    /// <summary>The exception that caused the incident.</summary>
 4566    public ExceptionState? Exception { get; init; }
 67
 68    /// <summary>
 69    /// The timestamp of the incident.
 70    /// </summary>
 3671    public DateTimeOffset Timestamp { get; init; }
 72}