< Summary

Information
Class: Elsa.Bpmn.Interchange.Exceptions.BpmnDuplicateElementIdException
Assembly: Elsa.Bpmn.Interchange
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Bpmn.Interchange/Exceptions/BpmnDuplicateElementIdException.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 19
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
.ctor(...)100%11100%
get_DuplicateElementIds()100%11100%

File(s)

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

#LineLine coverage
 1namespace Elsa.Bpmn.Interchange.Exceptions;
 2
 3/// <summary>
 4/// Thrown when a BPMN document declares the same element id more than once.
 5/// </summary>
 6/// <remarks>
 7/// BPMN requires every element id to be unique within a document. A repeat — most often a subprocess nested inside
 8/// another subprocess that reuses its parent's id — is not merely invalid input: <c>BpmnInterchangeDocumentService</c>'
 9/// own capability walk, <c>BpmnWorkBinder.BindScope</c> and <c>Bpmn.Interchange</c>'s own <c>BpmnXmlWriter</c> all read
 10/// "the nested processes belonging to this scope" back out of a flat binding list by matching on the repeated id, so a
 11/// document like this makes each of them recurse without ever terminating and crash the process outright — .NET
 12/// cannot catch a <see cref="StackOverflowException"/>. This is thrown, and the document refused, before any of that
 13/// recursion runs.
 14/// </remarks>
 1015public class BpmnDuplicateElementIdException(string message, IReadOnlyList<string> duplicateElementIds) : Exception(mess
 16{
 17    /// <summary>The element ids the document declares more than once.</summary>
 2018    public IReadOnlyList<string> DuplicateElementIds { get; } = duplicateElementIds;
 19}