| | | 1 | | using Elsa.Common.Entities; |
| | | 2 | | using Elsa.Workflows.Memory; |
| | | 3 | | using Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Workflows.Management.Entities; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Represents a versioned workflow definition. |
| | | 9 | | /// </summary> |
| | | 10 | | public class WorkflowDefinition : VersionedEntity |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// The logical ID of the workflow. This ID is the same across versions. |
| | | 14 | | /// </summary> |
| | 23064 | 15 | | public string DefinitionId { get; set; } = null!; |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// The name of the workflow. |
| | | 19 | | /// </summary> |
| | 2694 | 20 | | public string? Name { get; set; } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// A short description of what the workflow is about. |
| | | 24 | | /// </summary> |
| | 1929 | 25 | | public string? Description { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// The version of the tool that created this workflow. |
| | | 29 | | /// </summary> |
| | 1164 | 30 | | public Version? ToolVersion { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// A set of options for the workflow. |
| | | 34 | | /// </summary> |
| | 8810 | 35 | | public WorkflowOptions Options { get; set; } = new(); |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// A set of workflow variables that are accessible throughout the workflow. |
| | | 39 | | /// </summary> |
| | 7602 | 40 | | public ICollection<Variable> Variables { get; set; } = new List<Variable>(); |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// A set of input definitions. |
| | | 44 | | /// </summary> |
| | 8367 | 45 | | public ICollection<InputDefinition> Inputs { get; set; } = new List<InputDefinition>(); |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// A set of output definitions. |
| | | 49 | | /// </summary> |
| | 8367 | 50 | | public ICollection<OutputDefinition> Outputs { get; set; } = new List<OutputDefinition>(); |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// A set of possible outcomes for this workflow. |
| | | 54 | | /// </summary> |
| | 8367 | 55 | | public ICollection<string> Outcomes { get; set; } = new List<string>(); |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Stores custom information about the workflow. Can be used to store application-specific properties to associate |
| | | 59 | | /// </summary> |
| | 7602 | 60 | | public IDictionary<string, object> CustomProperties { get; set; } = new Dictionary<string, object>(); |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// The name of the workflow provider that created this workflow, if any. |
| | | 64 | | /// </summary> |
| | 1151 | 65 | | public string? ProviderName { get; set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// The name of the workflow materializer to interpret the <see cref="StringData"/> or <see cref="BinaryData"/>. |
| | | 69 | | /// </summary> |
| | 4866 | 70 | | public string MaterializerName { get; set; } = null!; |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Provider-specific data. |
| | | 74 | | /// </summary> |
| | 1633 | 75 | | public string? MaterializerContext { get; set; } |
| | | 76 | | |
| | | 77 | | /// <summary> |
| | | 78 | | /// A textual representation of the workflow. The data is to be interpreted by the configured materializer. |
| | | 79 | | /// </summary> |
| | 1168 | 80 | | public string? StringData { get; set; } |
| | | 81 | | |
| | | 82 | | /// <summary> |
| | | 83 | | /// The original source representation of the workflow (JSON, ElsaScript, YAML, etc.). |
| | | 84 | | /// When present, materializers should prefer this over StringData for full round-trip fidelity. |
| | | 85 | | /// This field enables symmetric materialization without requiring serialization round-trips. |
| | | 86 | | /// </summary> |
| | 2945 | 87 | | public string? OriginalSource { get; set; } |
| | | 88 | | |
| | | 89 | | /// <summary> |
| | | 90 | | /// A binary representation of the workflow. The data is to be interpreted by the configured materializer. |
| | | 91 | | /// </summary> |
| | 577 | 92 | | public byte[]? BinaryData { get; set; } |
| | | 93 | | |
| | | 94 | | /// <summary> |
| | | 95 | | /// An option to use the workflow as a readonly workflow |
| | | 96 | | /// </summary> |
| | 2058 | 97 | | public bool IsReadonly { get; set; } |
| | | 98 | | |
| | | 99 | | /// <summary> |
| | | 100 | | /// Specifies whether the workflow is a system workflow. |
| | | 101 | | /// System workflows are provided by modules and are not meant to be modified by users. |
| | | 102 | | /// </summary> |
| | 2053 | 103 | | public bool IsSystem { get; set; } |
| | | 104 | | |
| | | 105 | | /// <summary> |
| | | 106 | | /// Creates and returns a shallow copy of the workflow definition. |
| | | 107 | | /// </summary> |
| | 2 | 108 | | public WorkflowDefinition ShallowClone() => (WorkflowDefinition)MemberwiseClone(); |
| | | 109 | | } |