< Summary

Information
Class: Elsa.Workflows.CommitStates.Strategies.ActivityExecutingWorkflowStrategy
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/CommitStates/Strategies/Workflows/ActivityExecutingWorkflowStrategy.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/ActivityExecutingWorkflowStrategy.cs

#LineLine coverage
 1using System.ComponentModel;
 2
 3namespace Elsa.Workflows.CommitStates.Strategies;
 4
 5/// <summary>
 6/// Represents a workflow commit strategy that determines whether a commit should occur
 7/// during the ActivityExecuting lifecycle event of an activity.
 8/// </summary>
 9/// <remarks>
 10/// This strategy evaluates the workflow execution context and checks if the current lifecycle event is
 11/// <see cref="WorkflowLifetimeEvent.ActivityExecuting"/>. If the condition is met, the strategy indicates
 12/// that a commit action should be performed. Otherwise, a default action will be returned.
 13/// </remarks>
 14[DisplayName("Commit Before Activity Execution")]
 15[Description("Determines whether a workflow state should be committed if the current activity is executing.")]
 16public class ActivityExecutingWorkflowStrategy : IWorkflowCommitStrategy
 17{
 18    public CommitAction ShouldCommit(WorkflowCommitStateStrategyContext context)
 19    {
 020        return context.LifetimeEvent == WorkflowLifetimeEvent.ActivityExecuting ? CommitAction.Commit : CommitAction.Def
 21    }
 22}