< Summary

Information
Class: Elsa.Workflows.IncidentStrategies.FaultStrategy
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/IncidentStrategies/FaultStrategy.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 22
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
HandleIncident(...)100%22100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/IncidentStrategies/FaultStrategy.cs

#LineLine coverage
 1using System.ComponentModel;
 2using JetBrains.Annotations;
 3
 4// ReSharper disable once CheckNamespace
 5namespace Elsa.Workflows.IncidentStrategies;
 6
 7/// <summary>
 8/// An incident strategy that puts the entire workflow in the <c>Faulted</c> state.
 9/// </summary>
 10[PublicAPI]
 11[Description("An incident strategy that puts the entire workflow in the Faulted state.")]
 12public class FaultStrategy : IIncidentStrategy
 13{
 14    /// <inheritdoc />
 15    public void HandleIncident(ActivityExecutionContext context)
 16    {
 1317        var workflowExecutionContext = context.WorkflowExecutionContext;
 18
 1319        if(workflowExecutionContext.CanTransitionTo(WorkflowSubStatus.Faulted))
 1320            workflowExecutionContext.TransitionTo(WorkflowSubStatus.Faulted);
 1321    }
 22}