< Summary

Information
Class: Elsa.Workflows.Activities.Flowchart.Activities.FlowJoin
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Activities/Flowchart/Activities/FlowJoin.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 46
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Mode()100%11100%
ExecuteAsync()100%44100%

File(s)

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

#LineLine coverage
 1using System.Runtime.CompilerServices;
 2using Elsa.Workflows.Activities.Flowchart.Contracts;
 3using Elsa.Workflows.Activities.Flowchart.Extensions;
 4using Elsa.Workflows.Activities.Flowchart.Models;
 5using Elsa.Workflows.Attributes;
 6using Elsa.Workflows.Models;
 7using Elsa.Workflows.UIHints;
 8using JetBrains.Annotations;
 9
 10namespace Elsa.Workflows.Activities.Flowchart.Activities;
 11
 12/// <summary>
 13/// Merge multiple branches into a single branch of execution.
 14/// Note that this activity is no longer necessary for either AND or OR merges, because all activities inherit the Join 
 15/// Use this activity if an explicit join step is desired.
 16/// </summary>
 17[Activity("Elsa", "Branching", "Explicitly merge multiple branches into a single branch of execution.", DisplayName = "J
 18[UsedImplicitly]
 19public class FlowJoin : Activity, IJoinNode
 20{
 21    /// <inheritdoc />
 6622    public FlowJoin([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line)
 23    {
 6624    }
 25
 26    /// <summary>
 27    /// The join mode determines whether this activity should continue as soon as one inbound path comes in (Wait Any), 
 28    /// </summary>
 29    [Input(
 30        Description = "The join mode determines whether this activity should continue as soon as one inbound path comes 
 31        DefaultValue = FlowJoinMode.WaitAny,
 32        UIHint = InputUIHints.DropDown
 33    )]
 28034    public Input<FlowJoinMode> Mode { get; set; } = new(FlowJoinMode.WaitAny);
 35
 36    /// <inheritdoc />
 37    protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
 38    {
 2839        if(!Flowchart.UseTokenFlow)
 2840            if (context.ParentActivityExecutionContext != null)
 2241                await context.ParentActivityExecutionContext.CancelInboundAncestorsAsync(this);
 42
 43        // The join behavior is handled by Flowchart, so we can simply complete the activity here.
 2844        await context.CompleteActivityAsync();
 2845    }
 46}