< Summary

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

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Middleware/Workflows/PersistentVariablesMiddleware.cs

#LineLine coverage
 1using Elsa.Workflows.Pipelines.WorkflowExecution;
 2
 3namespace Elsa.Workflows.Runtime.Middleware.Workflows;
 4
 5/// <summary>
 6/// Takes care of loading and persisting workflow variables.
 7/// </summary>
 4398public class PersistentVariablesMiddleware(WorkflowMiddlewareDelegate next, IVariablePersistenceManager variablePersiste
 9{
 10    /// <inheritdoc />
 11    public override async ValueTask InvokeAsync(WorkflowExecutionContext context)
 12    {
 13        // Load variables into the workflow execution context.
 47114        await variablePersistenceManager.LoadVariablesAsync(context);
 15
 16        // Invoke next middleware.
 47117        await Next(context);
 18
 19        // Variables are persisted through the commit state handler.
 47120    }
 21}