| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// A bookmark represents a location in a workflow where the workflow can be resumed at a later time. |
| | | 7 | | /// </summary> |
| | | 8 | | /// <param name="id">The ID of the bookmark.</param> |
| | | 9 | | /// <param name="name">The name of the bookmark.</param> |
| | | 10 | | /// <param name="hash">The hash of the bookmark.</param> |
| | | 11 | | /// <param name="payload">The data associated with the bookmark.</param> |
| | | 12 | | /// <param name="activityId">The ID of the activity associated with the bookmark.</param> |
| | | 13 | | /// <param name="activityNodeId">The ID of the activity node associated with the bookmark.</param> |
| | | 14 | | /// <param name="activityInstanceId">The ID of the activity instance associated with the bookmark.</param> |
| | | 15 | | /// <param name="createdAt">The date and time the bookmark was created.</param> |
| | | 16 | | /// <param name="autoBurn">Whether or not the bookmark should be automatically burned.</param> |
| | | 17 | | /// <param name="callbackMethodName">The name of the method on the activity class to invoke when the bookmark is resumed |
| | | 18 | | /// <param name="autoComplete">Whether or not the activity should be automatically completed when the bookmark is resume |
| | | 19 | | /// <param name="metadata">Custom properties associated with the bookmark.</param> |
| | 129 | 20 | | public class Bookmark( |
| | 129 | 21 | | string id, |
| | 129 | 22 | | string name, |
| | 129 | 23 | | string hash, |
| | 129 | 24 | | object? payload, |
| | 129 | 25 | | string activityId, |
| | 129 | 26 | | string activityNodeId, |
| | 129 | 27 | | string? activityInstanceId, |
| | 129 | 28 | | DateTimeOffset createdAt, |
| | 129 | 29 | | bool autoBurn = true, |
| | 129 | 30 | | string? callbackMethodName = null, |
| | 129 | 31 | | bool autoComplete = true, |
| | 129 | 32 | | IDictionary<string, string>? metadata = null) |
| | | 33 | | { |
| | | 34 | | /// <inheritdoc /> |
| | | 35 | | [JsonConstructor] |
| | 53 | 36 | | public Bookmark() : this("", "", "", null, "", "", "", default, false) |
| | | 37 | | { |
| | 53 | 38 | | } |
| | | 39 | | |
| | | 40 | | /// <summary>The ID of the bookmark.</summary> |
| | 491 | 41 | | public string Id { get; set; } = id; |
| | | 42 | | |
| | | 43 | | /// <summary>The name of the bookmark.</summary> |
| | 718 | 44 | | public string Name { get; set; } = name; |
| | | 45 | | |
| | | 46 | | /// <summary>The hash of the bookmark.</summary> |
| | 276 | 47 | | public string Hash { get; set; } = hash; |
| | | 48 | | |
| | | 49 | | /// <summary>The data associated with the bookmark.</summary> |
| | 317 | 50 | | public object? Payload { get; set; } = payload; |
| | | 51 | | |
| | | 52 | | /// <summary>The ID of the activity associated with the bookmark.</summary> |
| | 233 | 53 | | public string ActivityId { get; set; } = activityId; |
| | | 54 | | |
| | | 55 | | /// <summary>The ID of the activity node associated with the bookmark.</summary> |
| | 348 | 56 | | public string ActivityNodeId { get; set; } = activityNodeId; |
| | | 57 | | |
| | | 58 | | /// <summary>The ID of the activity instance associated with the bookmark.</summary> |
| | 622 | 59 | | public string? ActivityInstanceId { get; set; } = activityInstanceId; |
| | | 60 | | |
| | | 61 | | /// <summary>The date and time the bookmark was created.</summary> |
| | 276 | 62 | | public DateTimeOffset CreatedAt { get; set; } = createdAt; |
| | | 63 | | |
| | | 64 | | /// <summary>Whether the bookmark should be automatically burned.</summary> |
| | 313 | 65 | | public bool AutoBurn { get; set; } = autoBurn; |
| | | 66 | | |
| | | 67 | | /// <summary>The name of the method on the activity class to invoke when the bookmark is resumed.</summary> |
| | 269 | 68 | | public string? CallbackMethodName { get; set; } = callbackMethodName; |
| | | 69 | | |
| | | 70 | | /// <summary>Whether the activity should be automatically completed when the bookmark is resumed.</summary> |
| | 249 | 71 | | public bool AutoComplete { get; set; } = autoComplete; |
| | | 72 | | |
| | | 73 | | /// <summary>Custom properties associated with the bookmark.</summary> |
| | 223 | 74 | | public IDictionary<string, string>? Metadata { get; set; } = metadata; |
| | | 75 | | } |