| | | 1 | | using Elsa.Workflows.Management.Entities; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Runtime.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a reloaded workflow definition with necessary properties for |
| | | 7 | | /// identification, versioning, and usability status as an activity. |
| | | 8 | | /// </summary> |
| | | 9 | | /// <param name="DefinitionId">The unique identifier for the workflow definition.</param> |
| | | 10 | | /// <param name="DefinitionVersionId">The unique identifier for the specific version of the workflow definition.</param> |
| | | 11 | | /// <param name="Version">The version number of the workflow definition.</param> |
| | | 12 | | /// <param name="UsableAsActivity">Indicates whether the workflow definition can be used as an activity.</param> |
| | 2160 | 13 | | public record ReloadedWorkflowDefinition(string DefinitionId, string DefinitionVersionId, int Version, bool UsableAsActi |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Creates an instance of <see cref="ReloadedWorkflowDefinition"/> from a given <see cref="WorkflowDefinition"/>. |
| | | 17 | | /// </summary> |
| | | 18 | | /// <param name="workflowDefinition">The workflow definition used to create the reloaded workflow definition.</param |
| | | 19 | | /// <returns>A new instance of <see cref="ReloadedWorkflowDefinition"/>.</returns> |
| | | 20 | | public static ReloadedWorkflowDefinition FromDefinition(WorkflowDefinition workflowDefinition) |
| | | 21 | | { |
| | 432 | 22 | | return new ReloadedWorkflowDefinition |
| | 432 | 23 | | ( |
| | 432 | 24 | | workflowDefinition.DefinitionId, |
| | 432 | 25 | | workflowDefinition.Id, |
| | 432 | 26 | | workflowDefinition.Version, |
| | 432 | 27 | | workflowDefinition.Options.UsableAsActivity ?? false |
| | 432 | 28 | | ); |
| | | 29 | | } |
| | | 30 | | } |