< Summary

Information
Class: Elsa.Workflows.Runtime.Models.ReloadedWorkflowDefinition
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Models/ReloadedWorkflowDefinition.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 30
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_DefinitionId()100%11100%
FromDefinition(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Models/ReloadedWorkflowDefinition.cs

#LineLine coverage
 1using Elsa.Workflows.Management.Entities;
 2
 3namespace 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>
 216013public 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    {
 43222        return new ReloadedWorkflowDefinition
 43223        (
 43224            workflowDefinition.DefinitionId,
 43225            workflowDefinition.Id,
 43226            workflowDefinition.Version,
 43227            workflowDefinition.Options.UsableAsActivity ?? false
 43228        );
 29    }
 30}