< Summary

Information
Class: Elsa.Workflows.Options.ActivityInvocationOptions
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Options/ActivityInvocationOptions.cs
Line coverage
47%
Covered lines: 11
Uncovered lines: 12
Coverable lines: 23
Total lines: 74
Line coverage: 47.8%
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
.ctor()100%11100%
.ctor(...)0%620%
get_Owner()100%11100%
get_Tag()100%11100%
get_Variables()100%11100%
get_ExistingActivityExecutionContext()100%11100%
get_Input()100%11100%
get_SchedulingActivityExecutionId()100%11100%
get_SchedulingWorkflowInstanceId()100%11100%
get_SchedulingCallStackDepth()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Options/ActivityInvocationOptions.cs

#LineLine coverage
 1using Elsa.Workflows.Memory;
 2
 3namespace Elsa.Workflows.Options;
 4
 5/// <summary>
 6/// Represents options for invoking an activity.
 7/// </summary>
 8public class ActivityInvocationOptions
 9{
 10    /// <summary>Initializes a new instance of the <see cref="ActivityInvocationOptions"/> class.</summary>
 332711    public ActivityInvocationOptions()
 12    {
 332713        Input = new Dictionary<string, object>();
 332714    }
 15
 16    /// <summary>Initializes a new instance of the <see cref="ActivityInvocationOptions"/> class.</summary>
 17    /// <param name="owner">The activity execution context that owns this invocation.</param>
 18    /// <param name="tag">An optional tag that can be used to identify the invocation.</param>
 19    /// <param name="variables">The variables to declare in the activity execution context that will be created for this
 20    /// <param name="existingActivityExecutionContext">An existing activity execution context to reuse.</param>
 21    /// <param name="input">Optional input to pass to the activity.</param>
 022    public ActivityInvocationOptions(
 023        ActivityExecutionContext? owner,
 024        object? tag,
 025        IEnumerable<Variable>? variables,
 026        ActivityExecutionContext? existingActivityExecutionContext = default,
 027        IDictionary<string, object>? input = default)
 28    {
 029        Owner = owner;
 030        Tag = tag;
 031        Variables = variables;
 032        ExistingActivityExecutionContext = existingActivityExecutionContext;
 033        Input = input ?? new Dictionary<string, object>();
 034    }
 35
 36    /// <summary>The activity execution context that owns this invocation.</summary>
 661337    public ActivityExecutionContext? Owner { get; set; }
 38
 39    /// <summary>An optional tag that can be used to identify the invocation.</summary>
 661340    public object? Tag { get; set; }
 41
 42    /// <summary>The variables to declare in the activity execution context that will be created for this invocation.</s
 661343    public IEnumerable<Variable>? Variables { get; set; }
 44
 45    /// <summary>An existing activity execution context to reuse.</summary>
 665046    public ActivityExecutionContext? ExistingActivityExecutionContext { get; set; }
 47
 48    /// <summary>
 49    /// Optional input to pass to the activity.
 50    /// </summary>
 994051    public IDictionary<string, object> Input { get; set; }
 52
 53    /// <summary>
 54    /// The ID of the activity execution context that scheduled this invocation.
 55    /// This represents the temporal/execution predecessor that directly triggered execution of this activity,
 56    /// distinct from the structural parent (<see cref="Owner"/>).
 57    /// </summary>
 2175458    public string? SchedulingActivityExecutionId { get; set; }
 59
 60    /// <summary>
 61    /// The workflow instance ID of the workflow that scheduled this invocation.
 62    /// This is set when crossing workflow boundaries (e.g., via ExecuteWorkflow or DispatchWorkflow).
 63    /// For activities within the same workflow instance, this will be null.
 64    /// </summary>
 661465    public string? SchedulingWorkflowInstanceId { get; set; }
 66
 67    /// <summary>
 68    /// The call stack depth of the scheduling activity execution context.
 69    /// This is used to calculate the call stack depth when the scheduling context is not present
 70    /// in ActivityExecutionContexts (e.g., for cross-workflow invocations).
 71    /// Should be set to the depth of the scheduling activity (not depth + 1, as the increment is applied automatically)
 72    /// </summary>
 333073    public int? SchedulingCallStackDepth { get; set; }
 74}