| | | 1 | | using Elsa.Workflows.Api.Models; |
| | | 2 | | using Elsa.Workflows.Management.Entities; |
| | | 3 | | using FastEndpoints; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Workflows.Api.Endpoints.WorkflowInstances.Get; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Maps a <see cref="WorkflowInstance"/> to <see cref="WorkflowInstanceModel"/>. |
| | | 9 | | /// </summary> |
| | | 10 | | internal class WorkflowInstanceMapper : ResponseMapper<WorkflowInstanceModel, WorkflowInstance>, IRequestMapper |
| | | 11 | | { |
| | | 12 | | /// <inheritdoc /> |
| | 0 | 13 | | public override WorkflowInstanceModel FromEntity(WorkflowInstance e) => new() |
| | 0 | 14 | | { |
| | 0 | 15 | | Id = e.Id, |
| | 0 | 16 | | DefinitionId = e.DefinitionId, |
| | 0 | 17 | | DefinitionVersionId = e.DefinitionVersionId, |
| | 0 | 18 | | Version = e.Version, |
| | 0 | 19 | | ParentWorkflowInstanceId = e.ParentWorkflowInstanceId, |
| | 0 | 20 | | WorkflowState = e.WorkflowState, |
| | 0 | 21 | | Status = e.Status, |
| | 0 | 22 | | SubStatus = e.SubStatus, |
| | 0 | 23 | | IsExecuting = e.IsExecuting, |
| | 0 | 24 | | CorrelationId = e.CorrelationId, |
| | 0 | 25 | | Name = e.Name, |
| | 0 | 26 | | IncidentCount = e.IncidentCount, |
| | 0 | 27 | | IsSystem = e.IsSystem, |
| | 0 | 28 | | CreatedAt = e.CreatedAt, |
| | 0 | 29 | | FinishedAt = e.FinishedAt, |
| | 0 | 30 | | UpdatedAt = e.UpdatedAt |
| | 0 | 31 | | }; |
| | | 32 | | } |