< Summary

Information
Class: Elsa.Workflows.Models.ActivityWorkItem
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/ActivityWorkItem.cs
Line coverage
100%
Covered lines: 29
Uncovered lines: 0
Coverable lines: 29
Total lines: 86
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
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%22100%
get_Activity()100%11100%
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/Models/ActivityWorkItem.cs

#LineLine coverage
 1using Elsa.Workflows.Memory;
 2
 3namespace Elsa.Workflows.Models;
 4
 5/// <summary>
 6/// Represents a work item that can be scheduled for execution.
 7/// </summary>
 8public class ActivityWorkItem
 9{
 10    /// <summary>
 11    /// Creates a new instance of the <see cref="ActivityWorkItem"/> class.
 12    /// </summary>
 347013    public ActivityWorkItem(
 347014        IActivity activity,
 347015        ActivityExecutionContext? owner = null,
 347016        object? tag = null,
 347017        IEnumerable<Variable>? variables = null,
 347018        ActivityExecutionContext? existingActivityExecutionContext = null,
 347019        IDictionary<string, object>? input = null,
 347020        string? schedulingActivityExecutionId = null,
 347021        string? schedulingWorkflowInstanceId = null,
 347022        int? schedulingCallStackDepth = null)
 23    {
 347024        Activity = activity;
 347025        Owner = owner;
 347026        Tag = tag;
 347027        Variables = variables;
 347028        ExistingActivityExecutionContext = existingActivityExecutionContext;
 347029        Input = input ?? new Dictionary<string, object>();
 347030        SchedulingActivityExecutionId = schedulingActivityExecutionId;
 347031        SchedulingWorkflowInstanceId = schedulingWorkflowInstanceId;
 347032        SchedulingCallStackDepth = schedulingCallStackDepth;
 347033    }
 34
 35    /// <summary>
 36    /// The activity to be executed.
 37    /// </summary>
 355038    public IActivity Activity { get; }
 39
 40    /// <summary>
 41    /// The activity execution context that owns this work item, if any.
 42    /// </summary>
 715843    public ActivityExecutionContext? Owner { get; set; }
 44
 45    /// <summary>
 46    /// A tag that can be used to identify the work item.
 47    /// </summary>
 677148    public object? Tag { get; set; }
 49
 50    /// <summary>
 51    /// A set of variables to be created as part of the activity execution context.
 52    /// </summary>
 680653    public IEnumerable<Variable>? Variables { get; set; }
 54
 55    /// <summary>
 56    /// An existing activity execution context to schedule, if any.
 57    /// </summary>
 680658    public ActivityExecutionContext? ExistingActivityExecutionContext { get; set; }
 59
 60    /// <summary>
 61    /// Optional input to pass to the activity.
 62    /// </summary>
 680663    public IDictionary<string, object> Input { get; set; }
 64
 65    /// <summary>
 66    /// The ID of the activity execution context that scheduled this work item.
 67    /// This represents the temporal/execution predecessor that directly triggered execution of this activity,
 68    /// distinct from the structural parent (<see cref="Owner"/>).
 69    /// </summary>
 677170    public string? SchedulingActivityExecutionId { get; set; }
 71
 72    /// <summary>
 73    /// The workflow instance ID of the workflow that scheduled this work item.
 74    /// This is set when crossing workflow boundaries (e.g., via ExecuteWorkflow or DispatchWorkflow).
 75    /// For activities within the same workflow instance, this will be null.
 76    /// </summary>
 677177    public string? SchedulingWorkflowInstanceId { get; set; }
 78
 79    /// <summary>
 80    /// The call stack depth of the scheduling activity execution context.
 81    /// This is used to calculate the call stack depth when the scheduling context is not present
 82    /// in ActivityExecutionContexts (e.g., for cross-workflow invocations).
 83    /// Should be set to the depth of the scheduling activity (not depth + 1, as the increment is applied automatically)
 84    /// </summary>
 677185    public int? SchedulingCallStackDepth { get; set; }
 86}