| | | 1 | | using Elsa.Workflows.Memory; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Options; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents options for invoking an activity. |
| | | 7 | | /// </summary> |
| | | 8 | | public class ActivityInvocationOptions |
| | | 9 | | { |
| | | 10 | | /// <summary>Initializes a new instance of the <see cref="ActivityInvocationOptions"/> class.</summary> |
| | 3327 | 11 | | public ActivityInvocationOptions() |
| | | 12 | | { |
| | 3327 | 13 | | Input = new Dictionary<string, object>(); |
| | 3327 | 14 | | } |
| | | 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> |
| | 0 | 22 | | public ActivityInvocationOptions( |
| | 0 | 23 | | ActivityExecutionContext? owner, |
| | 0 | 24 | | object? tag, |
| | 0 | 25 | | IEnumerable<Variable>? variables, |
| | 0 | 26 | | ActivityExecutionContext? existingActivityExecutionContext = default, |
| | 0 | 27 | | IDictionary<string, object>? input = default) |
| | | 28 | | { |
| | 0 | 29 | | Owner = owner; |
| | 0 | 30 | | Tag = tag; |
| | 0 | 31 | | Variables = variables; |
| | 0 | 32 | | ExistingActivityExecutionContext = existingActivityExecutionContext; |
| | 0 | 33 | | Input = input ?? new Dictionary<string, object>(); |
| | 0 | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary>The activity execution context that owns this invocation.</summary> |
| | 6613 | 37 | | public ActivityExecutionContext? Owner { get; set; } |
| | | 38 | | |
| | | 39 | | /// <summary>An optional tag that can be used to identify the invocation.</summary> |
| | 6613 | 40 | | 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 |
| | 6613 | 43 | | public IEnumerable<Variable>? Variables { get; set; } |
| | | 44 | | |
| | | 45 | | /// <summary>An existing activity execution context to reuse.</summary> |
| | 6650 | 46 | | public ActivityExecutionContext? ExistingActivityExecutionContext { get; set; } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Optional input to pass to the activity. |
| | | 50 | | /// </summary> |
| | 9940 | 51 | | 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> |
| | 21754 | 58 | | 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> |
| | 6614 | 65 | | 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> |
| | 3330 | 73 | | public int? SchedulingCallStackDepth { get; set; } |
| | | 74 | | } |