< Summary

Information
Class: Elsa.Workflows.Management.Models.WorkflowInstanceSummary
Assembly: Elsa.Workflows.Management
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Models/WorkflowInstanceSummary.cs
Line coverage
64%
Covered lines: 29
Uncovered lines: 16
Coverable lines: 45
Total lines: 93
Line coverage: 64.4%
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
FromInstance(...)100%210%
FromInstanceExpression()100%11100%
get_Id()100%11100%
get_TenantId()100%11100%
get_DefinitionId()100%11100%
get_DefinitionVersionId()100%11100%
get_Version()100%11100%
get_Status()100%11100%
get_SubStatus()100%11100%
get_CorrelationId()100%11100%
get_Name()100%11100%
get_IncidentCount()100%11100%
get_CreatedAt()100%11100%
get_UpdatedAt()100%11100%
get_FinishedAt()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Models/WorkflowInstanceSummary.cs

#LineLine coverage
 1using System.Linq.Expressions;
 2using Elsa.Workflows.Management.Entities;
 3
 4namespace Elsa.Workflows.Management.Models;
 5
 6/// <summary>
 7/// Represents a summary view of a <see cref="WorkflowInstance"/>.
 8/// </summary>
 9public class WorkflowInstanceSummary
 10{
 11    /// <summary>
 12    /// Returns a summary view of the specified <see cref="WorkflowInstance"/>.
 13    /// </summary>
 14    public static WorkflowInstanceSummary FromInstance(WorkflowInstance workflowInstance)
 15    {
 016        return new()
 017        {
 018            Id = workflowInstance.Id,
 019            TenantId = workflowInstance.TenantId,
 020            DefinitionId = workflowInstance.DefinitionId,
 021            DefinitionVersionId = workflowInstance.DefinitionVersionId,
 022            Version = workflowInstance.Version,
 023            Status = workflowInstance.Status,
 024            SubStatus = workflowInstance.SubStatus,
 025            CorrelationId = workflowInstance.CorrelationId,
 026            Name = workflowInstance.Name,
 027            IncidentCount = workflowInstance.IncidentCount,
 028            CreatedAt = workflowInstance.CreatedAt,
 029            UpdatedAt = workflowInstance.UpdatedAt,
 030            FinishedAt = workflowInstance.FinishedAt
 031        };
 32    }
 33
 34    /// <summary>
 35    /// Returns a summary view of the specified <see cref="WorkflowInstance"/>.
 36    /// </summary>
 7837    public static Expression<Func<WorkflowInstance, WorkflowInstanceSummary>> FromInstanceExpression() => workflowInstan
 7838    {
 7839        Id = workflowInstance.Id,
 7840        TenantId = workflowInstance.TenantId,
 7841        DefinitionId = workflowInstance.DefinitionId,
 7842        DefinitionVersionId = workflowInstance.DefinitionVersionId,
 7843        Version = workflowInstance.Version,
 7844        Status = workflowInstance.Status,
 7845        SubStatus = workflowInstance.SubStatus,
 7846        CorrelationId = workflowInstance.CorrelationId,
 7847        Name = workflowInstance.Name,
 7848        IncidentCount = workflowInstance.IncidentCount,
 7849        CreatedAt = workflowInstance.CreatedAt,
 7850        UpdatedAt = workflowInstance.UpdatedAt,
 7851        FinishedAt = workflowInstance.FinishedAt
 7852    };
 53
 54
 55    /// <summary>The ID of the workflow instance.</summary>
 656    public string Id { get; set; } = null!;
 57
 58    /// <summary>The ID of the tenant that owns the workflow instance.</summary>
 359    public string? TenantId { get; set; }
 60
 61    /// <summary>The ID of the workflow definition.</summary>
 362    public string DefinitionId { get; set; } = null!;
 63
 64    /// <summary>The version ID of the workflow definition.</summary>
 365    public string DefinitionVersionId { get; set; } = null!;
 66
 67    /// <summary>The version of the workflow definition.</summary>
 368    public int Version { get; set; }
 69
 70    /// <summary>The status of the workflow instance.</summary>
 371    public WorkflowStatus Status { get; set; }
 72
 73    /// <summary>The sub-status of the workflow instance.</summary>
 374    public WorkflowSubStatus SubStatus { get; set; }
 75
 76    /// <summary>The ID of the workflow instance.</summary>
 377    public string? CorrelationId { get; set; }
 78
 79    /// <summary>The name of the workflow instance.</summary>
 380    public string? Name { get; set; }
 81
 82    /// <summary>The number of incidents associated with the workflow instance.</summary>
 383    public int IncidentCount { get; set; }
 84
 85    /// <summary>The timestamp when the workflow instance was created.</summary>
 386    public DateTimeOffset CreatedAt { get; set; }
 87
 88    /// <summary>The timestamp when the workflow instance was last executed.</summary>
 389    public DateTimeOffset? UpdatedAt { get; set; }
 90
 91    /// <summary>The timestamp when the workflow instance was finished.</summary>
 392    public DateTimeOffset? FinishedAt { get; set; }
 93}