< 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>
 345013    public ActivityWorkItem(
 345014        IActivity activity,
 345015        ActivityExecutionContext? owner = null,
 345016        object? tag = null,
 345017        IEnumerable<Variable>? variables = null,
 345018        ActivityExecutionContext? existingActivityExecutionContext = null,
 345019        IDictionary<string, object>? input = null,
 345020        string? schedulingActivityExecutionId = null,
 345021        string? schedulingWorkflowInstanceId = null,
 345022        int? schedulingCallStackDepth = null)
 23    {
 345024        Activity = activity;
 345025        Owner = owner;
 345026        Tag = tag;
 345027        Variables = variables;
 345028        ExistingActivityExecutionContext = existingActivityExecutionContext;
 345029        Input = input ?? new Dictionary<string, object>();
 345030        SchedulingActivityExecutionId = schedulingActivityExecutionId;
 345031        SchedulingWorkflowInstanceId = schedulingWorkflowInstanceId;
 345032        SchedulingCallStackDepth = schedulingCallStackDepth;
 345033    }
 34
 35    /// <summary>
 36    /// The activity to be executed.
 37    /// </summary>
 347938    public IActivity Activity { get; }
 39
 40    /// <summary>
 41    /// The activity execution context that owns this work item, if any.
 42    /// </summary>
 711843    public ActivityExecutionContext? Owner { get; set; }
 44
 45    /// <summary>
 46    /// A tag that can be used to identify the work item.
 47    /// </summary>
 677548    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>
 681453    public IEnumerable<Variable>? Variables { get; set; }
 54
 55    /// <summary>
 56    /// An existing activity execution context to schedule, if any.
 57    /// </summary>
 681458    public ActivityExecutionContext? ExistingActivityExecutionContext { get; set; }
 59
 60    /// <summary>
 61    /// Optional input to pass to the activity.
 62    /// </summary>
 681463    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>
 677570    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>
 677577    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>
 677585    public int? SchedulingCallStackDepth { get; set; }
 86}