< 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: 27
Uncovered lines: 15
Coverable lines: 42
Total lines: 88
Line coverage: 64.2%
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_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            DefinitionId = workflowInstance.DefinitionId,
 020            DefinitionVersionId = workflowInstance.DefinitionVersionId,
 021            Version = workflowInstance.Version,
 022            Status = workflowInstance.Status,
 023            SubStatus = workflowInstance.SubStatus,
 024            CorrelationId = workflowInstance.CorrelationId,
 025            Name = workflowInstance.Name,
 026            IncidentCount = workflowInstance.IncidentCount,
 027            CreatedAt = workflowInstance.CreatedAt,
 028            UpdatedAt = workflowInstance.UpdatedAt,
 029            FinishedAt = workflowInstance.FinishedAt
 030        };
 31    }
 32
 33    /// <summary>
 34    /// Returns a summary view of the specified <see cref="WorkflowInstance"/>.
 35    /// </summary>
 836    public static Expression<Func<WorkflowInstance, WorkflowInstanceSummary>> FromInstanceExpression() => workflowInstan
 837    {
 838        Id = workflowInstance.Id,
 839        DefinitionId = workflowInstance.DefinitionId,
 840        DefinitionVersionId = workflowInstance.DefinitionVersionId,
 841        Version = workflowInstance.Version,
 842        Status = workflowInstance.Status,
 843        SubStatus = workflowInstance.SubStatus,
 844        CorrelationId = workflowInstance.CorrelationId,
 845        Name = workflowInstance.Name,
 846        IncidentCount = workflowInstance.IncidentCount,
 847        CreatedAt = workflowInstance.CreatedAt,
 848        UpdatedAt = workflowInstance.UpdatedAt,
 849        FinishedAt = workflowInstance.FinishedAt
 850    };
 51
 52
 53    /// <summary>The ID of the workflow instance.</summary>
 654    public string Id { get; set; } = null!;
 55
 56    /// <summary>The ID of the workflow definition.</summary>
 357    public string DefinitionId { get; set; } = null!;
 58
 59    /// <summary>The version ID of the workflow definition.</summary>
 360    public string DefinitionVersionId { get; set; } = null!;
 61
 62    /// <summary>The version of the workflow definition.</summary>
 363    public int Version { get; set; }
 64
 65    /// <summary>The status of the workflow instance.</summary>
 366    public WorkflowStatus Status { get; set; }
 67
 68    /// <summary>The sub-status of the workflow instance.</summary>
 369    public WorkflowSubStatus SubStatus { get; set; }
 70
 71    /// <summary>The ID of the workflow instance.</summary>
 372    public string? CorrelationId { get; set; }
 73
 74    /// <summary>The name of the workflow instance.</summary>
 375    public string? Name { get; set; }
 76
 77    /// <summary>The number of incidents associated with the workflow instance.</summary>
 378    public int IncidentCount { get; set; }
 79
 80    /// <summary>The timestamp when the workflow instance was created.</summary>
 381    public DateTimeOffset CreatedAt { get; set; }
 82
 83    /// <summary>The timestamp when the workflow instance was last executed.</summary>
 384    public DateTimeOffset? UpdatedAt { get; set; }
 85
 86    /// <summary>The timestamp when the workflow instance was finished.</summary>
 387    public DateTimeOffset? FinishedAt { get; set; }
 88}