< Summary

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

#LineLine coverage
 1using System.ComponentModel;
 2
 3namespace Elsa.Workflows.CommitStates.Strategies;
 4
 5/// <summary>
 6/// Represents a commit strategy that determines whether a workflow state should be committed
 7/// based on the "ActivityExecuted" lifetime event of an activity.
 8/// </summary>
 9/// <remarks>
 10/// This strategy evaluates the <see cref="WorkflowCommitStateStrategyContext"/> provided during execution
 11/// and returns a <see cref="CommitAction.Commit"/> action if the activity's lifetime event corresponds
 12/// to <see cref="WorkflowLifetimeEvent.ActivityExecuted"/>. Otherwise, it defaults to <see cref="CommitAction.Default"/
 13/// </remarks>
 14[DisplayName("Commit After Activity Execution")]
 15[Description("Determines whether a workflow state should be committed if the current activity has executed.")]
 16public class ActivityExecutedWorkflowStrategy : IWorkflowCommitStrategy
 17{
 18    public CommitAction ShouldCommit(WorkflowCommitStateStrategyContext context)
 19    {
 020        return context.LifetimeEvent == WorkflowLifetimeEvent.ActivityExecuted ? CommitAction.Commit : CommitAction.Defa
 21    }
 22}