< Summary

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

#LineLine coverage
 1using System.ComponentModel;
 2
 3namespace Elsa.Workflows.CommitStates.Strategies;
 4
 5/// <summary>
 6/// Represents an activity commit strategy that determines whether a commit action should occur
 7/// after an activity has executed within a workflow.
 8/// </summary>
 9/// <remarks>
 10/// This strategy evaluates the activity's execution events, specifically committing only if the
 11/// activity's lifetime event is "ActivityExecuted".
 12/// </remarks>
 13[DisplayName("Commit After")]
 14[Description("Commit the workflow state after the activity has executed.")]
 15public class ExecutedActivityStrategy : IActivityCommitStrategy
 16{
 17    public CommitAction ShouldCommit(ActivityCommitStateStrategyContext context)
 18    {
 019        return context.LifetimeEvent == ActivityLifetimeEvent.ActivityExecuted ? CommitAction.Commit : CommitAction.Defa
 20    }
 21}