< Summary

Information
Class: Elsa.Workflows.DefaultWorkflowInstanceVariableReader
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Services/DefaultWorkflowInstanceVariableReader.cs
Line coverage
92%
Covered lines: 12
Uncovered lines: 1
Coverable lines: 13
Total lines: 25
Line coverage: 92.3%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
GetVariables()75%4490.9%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Services/DefaultWorkflowInstanceVariableReader.cs

#LineLine coverage
 1namespace Elsa.Workflows;
 2
 33public class DefaultWorkflowInstanceVariableReader(IVariablePersistenceManager variablePersistenceManager) : IWorkflowIn
 4{
 5    public async Task<IEnumerable<ResolvedVariable>> GetVariables(WorkflowExecutionContext workflowExecutionContext, IEn
 6    {
 27        var workflow = workflowExecutionContext.Workflow;
 28        var workflowVariables = workflow.Variables;
 49        var rootWorkflowActivityExecutionContext = workflowExecutionContext.ActivityExecutionContexts.FirstOrDefault(x =
 10
 211        if (rootWorkflowActivityExecutionContext == null)
 012            return [];
 13
 214        await variablePersistenceManager.LoadVariablesAsync(workflowExecutionContext, excludeTags);
 215        var resolvedVariables = new List<ResolvedVariable>();
 16
 1017        foreach (var workflowVariable in workflowVariables)
 18        {
 319            var value = workflowVariable.Get(rootWorkflowActivityExecutionContext.ExpressionExecutionContext);
 320            resolvedVariables.Add(new(workflowVariable, value));
 21        }
 22
 223        return resolvedVariables;
 224    }
 25}