| | | 1 | | using Elsa.Workflows.Memory; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a work item that can be scheduled for execution. |
| | | 7 | | /// </summary> |
| | | 8 | | public class ActivityWorkItem |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Creates a new instance of the <see cref="ActivityWorkItem"/> class. |
| | | 12 | | /// </summary> |
| | 3143 | 13 | | public ActivityWorkItem( |
| | 3143 | 14 | | IActivity activity, |
| | 3143 | 15 | | ActivityExecutionContext? owner = null, |
| | 3143 | 16 | | object? tag = null, |
| | 3143 | 17 | | IEnumerable<Variable>? variables = null, |
| | 3143 | 18 | | ActivityExecutionContext? existingActivityExecutionContext = null, |
| | 3143 | 19 | | IDictionary<string, object>? input = null) |
| | | 20 | | { |
| | 3143 | 21 | | Activity = activity; |
| | 3143 | 22 | | Owner = owner; |
| | 3143 | 23 | | Tag = tag; |
| | 3143 | 24 | | Variables = variables; |
| | 3143 | 25 | | ExistingActivityExecutionContext = existingActivityExecutionContext; |
| | 3143 | 26 | | Input = input ?? new Dictionary<string, object>(); |
| | 3143 | 27 | | } |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// The activity to be executed. |
| | | 31 | | /// </summary> |
| | 3186 | 32 | | public IActivity Activity { get; } |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// The activity execution context that owns this work item, if any. |
| | | 36 | | /// </summary> |
| | 6512 | 37 | | public ActivityExecutionContext? Owner { get; set; } |
| | | 38 | | |
| | | 39 | | /// <summary> |
| | | 40 | | /// A tag that can be used to identify the work item. |
| | | 41 | | /// </summary> |
| | 6162 | 42 | | public object? Tag { get; set; } |
| | | 43 | | |
| | | 44 | | /// <summary> |
| | | 45 | | /// A set of variables to be created as part of the activity execution context. |
| | | 46 | | /// </summary> |
| | 6198 | 47 | | public IEnumerable<Variable>? Variables { get; set; } |
| | | 48 | | |
| | | 49 | | /// <summary> |
| | | 50 | | /// An existing activity execution context to schedule, if any. |
| | | 51 | | /// </summary> |
| | 6198 | 52 | | public ActivityExecutionContext? ExistingActivityExecutionContext { get; set; } |
| | | 53 | | |
| | | 54 | | /// <summary> |
| | | 55 | | /// Optional input to pass to the activity. |
| | | 56 | | /// </summary> |
| | 6198 | 57 | | public IDictionary<string, object> Input { get; set; } |
| | | 58 | | } |