< Summary

Information
Class: Elsa.Workflows.Activities.Finish
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Activities/Finish.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 27
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Execute(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Activities/Finish.cs

#LineLine coverage
 1using System.Runtime.CompilerServices;
 2using Elsa.Workflows.Attributes;
 3using JetBrains.Annotations;
 4
 5namespace Elsa.Workflows.Activities;
 6
 7/// <summary>
 8/// Mark the workflow as finished.
 9/// </summary>
 10[Activity("Elsa", "Primitives", "Mark the workflow as finished.")]
 11[PublicAPI]
 12public class Finish : CodeActivity, ITerminalNode
 13{
 14    /// <inheritdoc />
 915    public Finish([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line)
 16    {
 917    }
 18
 19    /// <inheritdoc />
 20    protected override void Execute(ActivityExecutionContext context)
 21    {
 322        context.ClearCompletionCallbacks();
 323        context.WorkflowExecutionContext.Scheduler.Clear();
 324        context.WorkflowExecutionContext.Bookmarks.Clear();
 325        context.WorkflowExecutionContext.TransitionTo(WorkflowSubStatus.Finished);
 326    }
 27}