< Summary

Information
Class: Elsa.Workflows.Api.Models.WorkflowInstanceModel
Assembly: Elsa.Workflows.Api
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Models/WorkflowInstanceModel.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 16
Coverable lines: 16
Total lines: 95
Line coverage: 0%
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_Id()100%210%
get_DefinitionId()100%210%
get_DefinitionVersionId()100%210%
get_Version()100%210%
get_ParentWorkflowInstanceId()100%210%
get_WorkflowState()100%210%
get_Status()100%210%
get_SubStatus()100%210%
get_IsExecuting()100%210%
get_CorrelationId()100%210%
get_Name()100%210%
get_IncidentCount()100%210%
get_IsSystem()100%210%
get_CreatedAt()100%210%
get_UpdatedAt()100%210%
get_FinishedAt()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Models/WorkflowInstanceModel.cs

#LineLine coverage
 1using Elsa.Workflows.State;
 2
 3namespace Elsa.Workflows.Api.Models;
 4
 5/// <summary>
 6/// Represents a workflow instance.
 7/// </summary>
 8public class WorkflowInstanceModel
 9{
 10    /// <summary>
 11    /// Gets or sets the ID of the workflow instance.
 12    /// </summary>
 013    public string Id { get; set; } = default!;
 14
 15    /// <summary>
 16    /// The ID of the workflow definition.
 17    /// </summary>
 018    public string DefinitionId { get; set; } = default!;
 19
 20    /// <summary>
 21    /// The version ID of the workflow definition.
 22    /// </summary>
 023    public string DefinitionVersionId { get; set; } = default!;
 24
 25    /// <summary>
 26    /// The version of the workflow definition.
 27    /// </summary>
 028    public int Version { get; set; }
 29
 30    /// <summary>
 31    /// The ID of the parent workflow instance.
 32    /// </summary>
 033    public string? ParentWorkflowInstanceId { get; set; }
 34
 35    /// <summary>
 36    /// The state of the workflow instance.
 37    /// </summary>
 038    public WorkflowState WorkflowState { get; set; } = default!;
 39
 40    /// <summary>
 41    /// The status of the workflow instance.
 42    /// </summary>
 043    public WorkflowStatus Status { get; set; }
 44
 45    /// <summary>
 46    /// The sub-status of the workflow instance.
 47    /// </summary>
 048    public WorkflowSubStatus SubStatus { get; set; }
 49
 50    /// <summary>
 51    /// Gets or sets a value indicating whether the workflow instance is actively executing.
 52    /// </summary>
 53    /// <remarks>
 54    /// This flag is set to <c>true</c> immediately before the workflow begins execution
 55    /// and is set to <c>false</c> once the execution is completed.
 56    /// It can be used to determine if a workflow instance was in-progress in case of unexpected
 57    /// application termination, allowing the system to retry execution upon restarting.
 58    /// </remarks>
 059    public bool IsExecuting { get; set; }
 60
 61    /// <summary>
 62    /// The ID of the workflow instance.
 63    /// </summary>
 064    public string? CorrelationId { get; set; }
 65
 66    /// <summary>
 67    /// The name of the workflow instance.
 68    /// </summary>
 069    public string? Name { get; set; }
 70
 71    /// <summary>
 72    /// The number of incidents that have occurred during execution, if any.
 73    /// </summary>
 074    public int IncidentCount { get; set; }
 75
 76    /// <summary>
 77    /// Gets or sets whether the workflow instance is a system workflow.
 78    /// </summary>
 079    public bool IsSystem { get; set; }
 80
 81    /// <summary>
 82    /// The timestamp when the workflow instance was created.
 83    /// </summary>
 084    public DateTimeOffset CreatedAt { get; set; }
 85
 86    /// <summary>
 87    /// The timestamp when the workflow instance was last executed.
 88    /// </summary>
 089    public DateTimeOffset UpdatedAt { get; set; }
 90
 91    /// <summary>
 92    /// The timestamp when the workflow instance was finished.
 93    /// </summary>
 094    public DateTimeOffset? FinishedAt { get; set; }
 95}