< Summary

Information
Class: Elsa.Bpmn.Interchange.Exceptions.BpmnExportUnavailableException
Assembly: Elsa.Bpmn.Interchange
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Bpmn.Interchange/Exceptions/BpmnExportUnavailableException.cs
Line coverage
66%
Covered lines: 4
Uncovered lines: 2
Coverable lines: 6
Total lines: 46
Line coverage: 66.6%
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
.ctor(...)100%210%
.ctor(...)100%11100%
get_Reason()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Bpmn.Interchange/Exceptions/BpmnExportUnavailableException.cs

#LineLine coverage
 1namespace Elsa.Bpmn.Interchange.Exceptions;
 2
 3/// <summary>
 4/// Thrown when a workflow definition cannot be exported as BPMN 2.0 XML because the source this deployment would
 5/// need to write back out is missing or no longer trustworthy.
 6/// </summary>
 7/// <remarks>
 8/// See <see cref="Services.BpmnInterchangeDocumentService"/>'s remarks for the distinct situations this covers — a
 9/// definition never imported from BPMN (or one whose source a later save dropped), one whose source predates the
 10/// version marker needed to check it is still current, and one that has changed since it was imported — and why
 11/// each gets its own message and its own <see cref="Reason"/>, which is what
 12/// <c>Endpoints.Bpmn.BpmnExportErrorResponses</c> maps to the response's <see cref="Elsa.Bpmn.Interchange.BpmnErrorCode
 13/// without having to parse the message.
 14/// </remarks>
 15public class BpmnExportUnavailableException : Exception
 16{
 17    /// <summary>Creates the exception with <see cref="BpmnExportUnavailableReason.NotImported"/> as its reason.</summar
 018    public BpmnExportUnavailableException(string message) : this(message, BpmnExportUnavailableReason.NotImported)
 19    {
 020    }
 21
 22    /// <summary>Creates the exception with an explicit <paramref name="reason"/>.</summary>
 1423    public BpmnExportUnavailableException(string message, BpmnExportUnavailableReason reason) : base(message)
 24    {
 1425        Reason = reason;
 1426    }
 27
 28    /// <summary>Which of the situations this type's remarks describe <see cref="Exception.Message"/> reports.</summary>
 729    public BpmnExportUnavailableReason Reason { get; }
 30}
 31
 32/// <summary>The distinct situations a <see cref="BpmnExportUnavailableException"/> reports.</summary>
 33public enum BpmnExportUnavailableReason
 34{
 35    /// <summary>The definition does not currently carry BPMN source at all.</summary>
 36    NotImported,
 37
 38    /// <summary>
 39    /// The definition carries BPMN source but not the definition version it was recorded against, so whether that
 40    /// source is still current cannot be verified.
 41    /// </summary>
 42    SourceVersionUnknown,
 43
 44    /// <summary>The definition has changed — by version, or (for an unpublished draft) by activity graph — since the so
 45    SourceStale
 46}