< Summary

Information
Class: Elsa.Workflows.Management.Entities.WorkflowDefinition
Assembly: Elsa.Workflows.Management
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Entities/WorkflowDefinition.cs
Line coverage
100%
Covered lines: 19
Uncovered lines: 0
Coverable lines: 19
Total lines: 109
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%
get_Name()100%11100%
get_Description()100%11100%
get_ToolVersion()100%11100%
get_Options()100%11100%
get_Variables()100%11100%
get_Inputs()100%11100%
get_Outputs()100%11100%
get_Outcomes()100%11100%
get_CustomProperties()100%11100%
get_ProviderName()100%11100%
get_MaterializerName()100%11100%
get_MaterializerContext()100%11100%
get_StringData()100%11100%
get_OriginalSource()100%11100%
get_BinaryData()100%11100%
get_IsReadonly()100%11100%
get_IsSystem()100%11100%
ShallowClone()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Entities/WorkflowDefinition.cs

#LineLine coverage
 1using Elsa.Common.Entities;
 2using Elsa.Workflows.Memory;
 3using Elsa.Workflows.Models;
 4
 5namespace Elsa.Workflows.Management.Entities;
 6
 7/// <summary>
 8/// Represents a versioned workflow definition.
 9/// </summary>
 10public class WorkflowDefinition : VersionedEntity
 11{
 12    /// <summary>
 13    /// The logical ID of the workflow. This ID is the same across versions.
 14    /// </summary>
 2306415    public string DefinitionId { get; set; } = null!;
 16
 17    /// <summary>
 18    /// The name of the workflow.
 19    /// </summary>
 269420    public string? Name { get; set; }
 21
 22    /// <summary>
 23    /// A short description of what the workflow is about.
 24    /// </summary>
 192925    public string? Description { get; set; }
 26
 27    /// <summary>
 28    /// The version of the tool that created this workflow.
 29    /// </summary>
 116430    public Version? ToolVersion { get; set; }
 31
 32    /// <summary>
 33    /// A set of options for the workflow.
 34    /// </summary>
 881035    public WorkflowOptions Options { get; set; } = new();
 36
 37    /// <summary>
 38    /// A set of workflow variables that are accessible throughout the workflow.
 39    /// </summary>
 760240    public ICollection<Variable> Variables { get; set; } = new List<Variable>();
 41
 42    /// <summary>
 43    /// A set of input definitions.
 44    /// </summary>
 836745    public ICollection<InputDefinition> Inputs { get; set; } = new List<InputDefinition>();
 46
 47    /// <summary>
 48    /// A set of output definitions.
 49    /// </summary>
 836750    public ICollection<OutputDefinition> Outputs { get; set; } = new List<OutputDefinition>();
 51
 52    /// <summary>
 53    /// A set of possible outcomes for this workflow.
 54    /// </summary>
 836755    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>
 760260    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>
 115165    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>
 486670    public string MaterializerName { get; set; } = null!;
 71
 72    /// <summary>
 73    /// Provider-specific data.
 74    /// </summary>
 163375    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>
 116880    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>
 294587    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>
 57792    public byte[]? BinaryData { get; set; }
 93
 94    /// <summary>
 95    /// An option to use the workflow as a readonly workflow
 96    /// </summary>
 205897    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>
 2053103    public bool IsSystem { get; set; }
 104
 105    /// <summary>
 106    /// Creates and returns a shallow copy of the workflow definition.
 107    /// </summary>
 2108    public WorkflowDefinition ShallowClone() => (WorkflowDefinition)MemberwiseClone();
 109}