< Summary

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

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ShouldCommit(...)0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/CommitStates/Strategies/Workflows/WorkflowExecutingWorkflowStrategy.cs

#LineLine coverage
 1using System.ComponentModel;
 2
 3namespace Elsa.Workflows.CommitStates.Strategies;
 4
 5/// <summary>
 6/// Implements a commit strategy that determines whether the workflow state
 7/// should be committed when the workflow is in the "executing" lifetime event.
 8/// </summary>
 9/// <remarks>
 10/// This strategy checks the current context's `LifetimeEvent` and commits
 11/// the workflow state if it corresponds to the `WorkflowExecuting` event.
 12/// Otherwise, it defaults to no explicit commit action.
 13/// </remarks>
 14[DisplayName("Commit Before Workflow Execution")]
 15[Description("Commit the workflow state when the workflow is executing.")]
 16public class WorkflowExecutingWorkflowStrategy : IWorkflowCommitStrategy
 17{
 18    public CommitAction ShouldCommit(WorkflowCommitStateStrategyContext context)
 19    {
 020        return context.LifetimeEvent == WorkflowLifetimeEvent.WorkflowExecuting ? CommitAction.Commit : CommitAction.Def
 21    }
 22}