< 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 />
 5196public class WorkflowExecutionLogRecordExtractor(IIdentityGenerator identityGenerator) : ILogRecordExtractor<WorkflowExe
 7{
 8    /// <inheritdoc />
 9    public Task<IEnumerable<WorkflowExecutionLogRecord>> ExtractLogRecordsAsync(WorkflowExecutionContext context)
 10    {
 853011        var records = context.ExecutionLog.Select(x => new WorkflowExecutionLogRecord
 853012        {
 853013            Id = identityGenerator.GenerateId(),
 853014            ActivityInstanceId = x.ActivityInstanceId,
 853015            ParentActivityInstanceId = x.ParentActivityInstanceId,
 853016            ActivityNodeId = x.NodeId,
 853017            ActivityId = x.ActivityId,
 853018            ActivityType = x.ActivityType,
 853019            ActivityTypeVersion = x.ActivityTypeVersion,
 853020            ActivityName = x.ActivityName,
 853021            Message = x.Message,
 853022            EventName = x.EventName,
 853023            WorkflowDefinitionId = context.Workflow.Identity.DefinitionId,
 853024            WorkflowDefinitionVersionId = context.Workflow.Identity.Id,
 853025            WorkflowInstanceId = context.Id,
 853026            WorkflowVersion = context.Workflow.Version,
 853027            Source = x.Source,
 853028            Payload = x.Payload,
 853029            Timestamp = x.Timestamp,
 853030            Sequence = x.Sequence
 853031        });
 32
 54033        return Task.FromResult(records);
 34    }
 35}