| | | 1 | | // ReSharper disable AutoPropertyCanBeMadeGetOnly.Global |
| | | 2 | | // Required for JSON serialization configured with reference handling. |
| | | 3 | | namespace Elsa.Workflows.State; |
| | | 4 | | |
| | | 5 | | // Can't use records when using System.Text.Json serialization and reference handling. Hence, using a class with default |
| | | 6 | | //public record CompletionCallbackState(string OwnerId, string ChildId, string MethodName); |
| | | 7 | | |
| | | 8 | | /// <summary> |
| | | 9 | | /// Represents a serializable completion callback that is registered by an activity. |
| | | 10 | | /// </summary> |
| | | 11 | | public class CompletionCallbackState |
| | | 12 | | { |
| | | 13 | | // ReSharper disable once UnusedMember.Global |
| | | 14 | | // Required for JSON serialization configured with reference handling. |
| | | 15 | | /// <summary> |
| | | 16 | | /// Creates a new instance of the <see cref="CompletionCallbackState"/> class. |
| | | 17 | | /// </summary> |
| | 116 | 18 | | public CompletionCallbackState() |
| | | 19 | | { |
| | 116 | 20 | | } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Creates a new instance of the <see cref="CompletionCallbackState"/> class. |
| | | 24 | | /// </summary> |
| | | 25 | | /// <param name="ownerInstanceId">The ID of the activity instance that registered the callback.</param> |
| | | 26 | | /// <param name="childNodeId">The ID of the child node that the callback is registered for.</param> |
| | | 27 | | /// <param name="methodName">The name of the method to invoke when the child node completes.</param> |
| | | 28 | | /// <param name="tag">An optional tag.</param> |
| | 126 | 29 | | public CompletionCallbackState(string ownerInstanceId, string childNodeId, string? methodName, object? tag = default |
| | | 30 | | { |
| | 126 | 31 | | OwnerInstanceId = ownerInstanceId; |
| | 126 | 32 | | ChildNodeId = childNodeId; |
| | 126 | 33 | | MethodName = methodName; |
| | 126 | 34 | | Tag = tag; |
| | 126 | 35 | | } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Gets the ID of the activity instance that registered the callback. |
| | | 39 | | /// </summary> |
| | 609 | 40 | | public string OwnerInstanceId { get; init; } = default!; |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Gets the ID of the child node that the callback is registered for. |
| | | 44 | | /// </summary> |
| | 444 | 45 | | public string ChildNodeId { get; init; } = default!; |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets the name of the method to invoke when the child node completes. |
| | | 49 | | /// </summary> |
| | 444 | 50 | | public string? MethodName { get; init; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets the tag. |
| | | 54 | | /// </summary> |
| | 328 | 55 | | public object? Tag { get; init; } |
| | | 56 | | } |