< Summary

Information
Class: Elsa.Workflows.TriggerIndexingContext
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/TriggerIndexingContext.cs
Line coverage
75%
Covered lines: 6
Uncovered lines: 2
Coverable lines: 8
Total lines: 42
Line coverage: 75%
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%
get_WorkflowIndexingContext()100%11100%
get_ExpressionExecutionContext()100%11100%
get_Trigger()100%11100%
get_CancellationToken()100%11100%
get_TriggerName()100%11100%
get_RegistersNoTriggers()100%210%
Get(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/TriggerIndexingContext.cs

#LineLine coverage
 1using Elsa.Expressions.Models;
 2using Elsa.Extensions;
 3using Elsa.Workflows.Models;
 4
 5namespace Elsa.Workflows;
 6
 3057public class TriggerIndexingContext(WorkflowIndexingContext workflowIndexingContext, ExpressionExecutionContext expressi
 8{
 3059    public WorkflowIndexingContext WorkflowIndexingContext { get; } = workflowIndexingContext;
 61010    public ExpressionExecutionContext ExpressionExecutionContext { get; } = expressionExecutionContext;
 30511    public ITrigger Trigger { get; } = trigger;
 30512    public CancellationToken CancellationToken { get; } = cancellationToken;
 13
 14    /// <summary>
 15    /// The default stimulus name applied to the payloads returned by the trigger being indexed. Defaults to the activit
 16    /// </summary>
 17    /// <remarks>
 18    /// This is a single value shared by every payload of the trigger: when it is assigned more than once, the last writ
 19    /// A trigger that needs to register payloads under more than one stimulus name should return <see cref="NamedTrigge
 20    /// which carry a name per payload and take precedence over this property.
 21    /// </remarks>
 91422    public string TriggerName { get; set; } = trigger.Type;
 23
 24    /// <summary>
 25    /// Set by the trigger being indexed to declare that, as configured, it deliberately registers no triggers at all.
 26    /// </summary>
 27    /// <remarks>
 28    /// <para>
 29    /// A trigger that returns no payloads is otherwise stored as a single placeholder row with a <c>null</c> payload, w
 30    /// reports as a trigger without a payload. For almost every trigger that is the right outcome: no payloads means it
 31    /// A trigger whose decision to register anything depends on its own content, and that has nothing to register as co
 32    /// and the indexer then stores no row for it.
 33    /// </para>
 34    /// <para>
 35    /// It only takes effect when the trigger returns no payloads and completes without throwing. Payloads the trigger d
 36    /// and a trigger that throws still gets the placeholder row, so a failure is never mistaken for a deliberate decisi
 37    /// </para>
 38    /// </remarks>
 039    public bool RegistersNoTriggers { get; set; }
 40
 041    public T? Get<T>(Input<T>? input) => ExpressionExecutionContext.Get(input);
 42}