| | | 1 | | using Bpmn.Interchange; |
| | | 2 | | using JetBrains.Annotations; |
| | | 3 | | |
| | | 4 | | namespace Elsa.Bpmn.Interchange.Endpoints.Bpmn; |
| | | 5 | | |
| | | 6 | | /// <summary>One element-scoped finding from a BPMN read, as reported over the API.</summary> |
| | | 7 | | [PublicAPI] |
| | | 8 | | public sealed class BpmnImportIssueModel |
| | | 9 | | { |
| | | 10 | | /// <summary>How much of the element's authored meaning survived the read: <c>Info</c>, <c>Degraded</c> or <c>Droppe |
| | 27 | 11 | | public string Severity { get; init; } = string.Empty; |
| | | 12 | | |
| | | 13 | | /// <summary>A sentence naming the element, what the document said, and what the reader did about it.</summary> |
| | 27 | 14 | | public string Message { get; init; } = string.Empty; |
| | | 15 | | |
| | | 16 | | /// <summary>The BPMN id the finding is about, when it is about one element.</summary> |
| | 18 | 17 | | public string? ElementId { get; init; } |
| | | 18 | | |
| | | 19 | | /// <summary>The process the finding occurred in, when it is scoped to one.</summary> |
| | 18 | 20 | | public string? ProcessId { get; init; } |
| | | 21 | | |
| | | 22 | | /// <summary>Maps a library finding onto the API model.</summary> |
| | 9 | 23 | | public static BpmnImportIssueModel From(BpmnImportIssue issue) => new() |
| | 9 | 24 | | { |
| | 9 | 25 | | Severity = issue.Severity.ToString(), |
| | 9 | 26 | | Message = issue.Message, |
| | 9 | 27 | | ElementId = issue.ElementId, |
| | 9 | 28 | | ProcessId = issue.ProcessId |
| | 9 | 29 | | }; |
| | | 30 | | } |