| | | 1 | | namespace Elsa.Workflows.Models; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents a handle to an activity. |
| | | 5 | | /// </summary> |
| | | 6 | | public class ActivityHandle |
| | | 7 | | { |
| | 0 | 8 | | public static ActivityHandle FromActivityId(string activityId) => new() |
| | 0 | 9 | | { |
| | 0 | 10 | | ActivityId = activityId |
| | 0 | 11 | | }; |
| | | 12 | | |
| | 0 | 13 | | public static ActivityHandle FromActivityNodeId(string activityNodeId) => new() |
| | 0 | 14 | | { |
| | 0 | 15 | | ActivityNodeId = activityNodeId |
| | 0 | 16 | | }; |
| | | 17 | | |
| | 2 | 18 | | public static ActivityHandle FromActivityInstanceId(string activityInstanceId) => new() |
| | 2 | 19 | | { |
| | 2 | 20 | | ActivityInstanceId = activityInstanceId |
| | 2 | 21 | | }; |
| | | 22 | | |
| | 0 | 23 | | public static ActivityHandle FromActivityHash(string activityHash) => new() |
| | 0 | 24 | | { |
| | 0 | 25 | | ActivityHash = activityHash |
| | 0 | 26 | | }; |
| | | 27 | | |
| | 0 | 28 | | public string? ActivityId { get; init; } |
| | 0 | 29 | | public string? ActivityNodeId { get; init; } |
| | 2 | 30 | | public string? ActivityInstanceId { get; init; } |
| | 0 | 31 | | public string? ActivityHash { get; init; } |
| | | 32 | | |
| | | 33 | | public override string ToString() |
| | | 34 | | { |
| | 0 | 35 | | return ActivityId ?? (ActivityNodeId ?? (ActivityInstanceId ?? (ActivityHash ?? ""))); |
| | | 36 | | } |
| | | 37 | | } |