< Summary

Information
Class: Elsa.Workflows.CommitStates.Strategies.ExecutingActivityStrategy
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/CommitStates/Strategies/Activities/ExecutingActivityStrategy.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 23
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/Activities/ExecutingActivityStrategy.cs

#LineLine coverage
 1using System.ComponentModel;
 2
 3namespace Elsa.Workflows.CommitStates.Strategies;
 4
 5/// <summary>
 6/// Represents a commit strategy that evaluates whether a workflow commit should occur
 7/// when an activity is in the "Executing" state.
 8/// </summary>
 9/// <remarks>
 10/// This strategy determines commit behavior based on the activity's lifecycle event.
 11/// Specifically, it commits the workflow if the activity is currently executing
 12/// (i.e., the lifetime event is `ActivityLifetimeEvent.ActivityExecuting`).
 13/// For all other states, it defaults to no specific commit action.
 14/// </remarks>
 15[DisplayName("Commit Before")]
 16[Description("Commit the workflow state when the activity is executing.")]
 17public class ExecutingActivityStrategy : IActivityCommitStrategy
 18{
 19    public CommitAction ShouldCommit(ActivityCommitStateStrategyContext context)
 20    {
 021        return context.LifetimeEvent == ActivityLifetimeEvent.ActivityExecuting ? CommitAction.Commit : CommitAction.Def
 22    }
 23}