< Summary

Information
Class: Elsa.Workflows.Runtime.WorkflowExecutionLogRecordExtractor
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/WorkflowExecutionLogRecordExtractor.cs
Line coverage
100%
Covered lines: 23
Uncovered lines: 0
Coverable lines: 23
Total lines: 35
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%
ExtractLogRecordsAsync(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/WorkflowExecutionLogRecordExtractor.cs

#LineLine coverage
 1using Elsa.Workflows.Runtime.Entities;
 2
 3namespace Elsa.Workflows.Runtime;
 4
 5/// <inheritdoc />
 5366public class WorkflowExecutionLogRecordExtractor(IIdentityGenerator identityGenerator) : ILogRecordExtractor<WorkflowExe
 7{
 8    /// <inheritdoc />
 9    public Task<IEnumerable<WorkflowExecutionLogRecord>> ExtractLogRecordsAsync(WorkflowExecutionContext context)
 10    {
 874111        var records = context.ExecutionLog.Select(x => new WorkflowExecutionLogRecord
 874112        {
 874113            Id = identityGenerator.GenerateId(),
 874114            ActivityInstanceId = x.ActivityInstanceId,
 874115            ParentActivityInstanceId = x.ParentActivityInstanceId,
 874116            ActivityNodeId = x.NodeId,
 874117            ActivityId = x.ActivityId,
 874118            ActivityType = x.ActivityType,
 874119            ActivityTypeVersion = x.ActivityTypeVersion,
 874120            ActivityName = x.ActivityName,
 874121            Message = x.Message,
 874122            EventName = x.EventName,
 874123            WorkflowDefinitionId = context.Workflow.Identity.DefinitionId,
 874124            WorkflowDefinitionVersionId = context.Workflow.Identity.Id,
 874125            WorkflowInstanceId = context.Id,
 874126            WorkflowVersion = context.Workflow.Version,
 874127            Source = x.Source,
 874128            Payload = x.Payload,
 874129            Timestamp = x.Timestamp,
 874130            Sequence = x.Sequence
 874131        });
 32
 56733        return Task.FromResult(records);
 34    }
 35}