< Summary

Information
Class: Elsa.Workflows.Models.ActivityDescriptor
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/ActivityDescriptor.cs
Line coverage
100%
Covered lines: 23
Uncovered lines: 0
Coverable lines: 23
Total lines: 138
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_TenantId()100%11100%
get_TypeName()100%11100%
get_ClrType()100%11100%
get_Namespace()100%11100%
get_Name()100%11100%
get_Version()100%11100%
get_Category()100%11100%
get_DisplayName()100%11100%
get_Description()100%11100%
get_Inputs()100%11100%
get_Outputs()100%11100%
get_Attributes()100%11100%
get_Constructor()100%11100%
get_Kind()100%11100%
get_RunAsynchronously()100%11100%
get_Ports()100%11100%
get_CustomProperties()100%11100%
get_ConstructionProperties()100%11100%
get_IsContainer()100%11100%
get_IsBrowsable()100%11100%
get_IsStart()100%11100%
get_IsTerminal()100%11100%
get_ConfigureSerializerOptions()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Models/ActivityDescriptor.cs

#LineLine coverage
 1using System.Diagnostics;
 2using System.Text.Json;
 3using System.Text.Json.Serialization;
 4
 5namespace Elsa.Workflows.Models;
 6
 7/// <summary>
 8/// A descriptor of an activity type. It also provides a constructor to create instances of this type.
 9/// </summary>
 10[DebuggerDisplay("{TypeName}")]
 11public class ActivityDescriptor
 12{
 1831313    public string? TenantId { get; set; } // Null means tenant-agnostic.
 14
 15    /// <summary>
 16    /// The fully qualified name of the activity type.
 17    /// </summary>
 94883618    public string TypeName { get; set; } = null!;
 19
 20    /// <summary>
 21    /// The .NET type of the activity type.
 22    /// </summary>
 1899523    public Type ClrType { get; set; } = null!;
 24
 25    /// <summary>
 26    /// The namespace of the activity type.
 27    /// </summary>
 1710428    public string Namespace { get; set; } = null!;
 29
 30    /// <summary>
 31    /// The name of the activity type.
 32    /// </summary>
 1909433    public string Name { get; set; } = null!;
 34
 35    /// <summary>
 36    /// The version of the activity type.
 37    /// </summary>
 6364038    public int Version { get; set; }
 39
 40    /// <summary>
 41    /// The category of the activity type.
 42    /// </summary>
 1900543    public string Category { get; set; } = null!;
 44
 45    /// <summary>
 46    /// The display name of the activity type.
 47    /// </summary>
 1899648    public string? DisplayName { get; set; }
 49
 50    /// <summary>
 51    /// The description of the activity type.
 52    /// </summary>
 1900353    public string? Description { get; set; }
 54
 55    /// <summary>
 56    /// The input properties of the activity type.
 57    /// </summary>
 11034358    public ICollection<InputDescriptor> Inputs { get; init; } = new List<InputDescriptor>();
 59
 60    /// <summary>
 61    /// The output properties of the activity type.
 62    /// </summary>
 7342163    public ICollection<OutputDescriptor> Outputs { get; init; } = new List<OutputDescriptor>();
 64
 65    /// <summary>
 66    /// The attributes of the activity type.
 67    /// </summary>
 3528468    [JsonIgnore] public ICollection<Attribute> Attributes { get; set; } = new List<Attribute>();
 69
 70    /// <summary>
 71    /// Instantiates a concrete instance of an <see cref="IActivity"/>.
 72    /// </summary>
 73    [JsonIgnore]
 2427274    public Func<ActivityConstructorContext, ActivityConstructionResult> Constructor { get; set; } = null!;
 75
 76    /// <summary>
 77    /// The kind of activity.
 78    /// </summary>
 2892179    public ActivityKind Kind { get; set; } = ActivityKind.Action;
 80
 81    /// <summary>
 82    /// Whether the activity should be executed asynchronously. Applies only when the Kind is set to Task and as a defau
 83    /// </summary>
 157884    public bool RunAsynchronously { get; set; }
 85
 86    /// <summary>
 87    /// The ports of the activity type.
 88    /// </summary>
 3601589    public ICollection<Port> Ports { get; set; } = new List<Port>();
 90
 91    /// <summary>
 92    /// The custom properties of the activity type.
 93    /// </summary>
 7848494    public IDictionary<string, object> CustomProperties { get; set; } = new Dictionary<string, object>();
 95
 96    /// <summary>
 97    /// The properties to set when constructing an activity in the designer.
 98    /// </summary>
 1891199    public IDictionary<string, object> ConstructionProperties { get; set; } = new Dictionary<string, object>();
 100
 101    /// <summary>
 102    /// A value indicating whether this activity is a container of child activities.
 103    /// </summary>
 17104104    public bool IsContainer { get; set; }
 105
 106    /// <summary>
 107    /// Whether this activity type is selectable from activity pickers.
 108    /// </summary>
 37030109    public bool IsBrowsable { get; set; } = true;
 110
 111    /// <summary>
 112    /// Whether this activity type is a start activity.
 113    /// </summary>
 17104114    public bool IsStart { get; set; }
 115
 116    /// <summary>
 117    /// Whether this activity type is a terminal activity.
 118    /// </summary>
 17104119    public bool IsTerminal { get; set; }
 120
 121    /// <summary>
 122    /// Gets or sets a function that allows configuring the JsonSerializerOptions for the activity during serialization.
 123    /// </summary>
 124    /// <remarks>
 125    /// This function can be used to customize the serialization options for an activity. It receives a JsonSerializerOp
 126    /// object as an argument and should return the modified JsonSerializerOptions.
 127    /// <para>Example:</para>
 128    /// <code>
 129    /// activityDescriptor.ConfigureSerializerOptions = options =>
 130    /// {
 131    /// options.Converters.Add(new JsonIgnoreCompositeRootConverterFactory());
 132    /// return options;
 133    /// };
 134    /// </code>
 135    /// </remarks>
 136    [JsonIgnore]
 3454137    public Func<JsonSerializerOptions, JsonSerializerOptions>? ConfigureSerializerOptions { get; set; }
 138}