< Summary

Information
Class: Elsa.Workflows.Runtime.DefaultWorkflowRestarter
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/DefaultWorkflowRestarter.cs
Line coverage
16%
Covered lines: 1
Uncovered lines: 5
Coverable lines: 6
Total lines: 18
Line coverage: 16.6%
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%
RestartWorkflowAsync()100%210%

File(s)

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

#LineLine coverage
 1using Elsa.Workflows.Runtime.Requests;
 2using Microsoft.Extensions.Logging;
 3
 4namespace Elsa.Workflows.Runtime;
 5
 6/// <inheritdoc />
 57public class DefaultWorkflowRestarter(IWorkflowDispatcher workflowDispatcher, ILogger<DefaultWorkflowRestarter> logger) 
 8{
 9    /// <inheritdoc />
 10    public async Task RestartWorkflowAsync(string workflowInstanceId, CancellationToken cancellationToken = default)
 11    {
 012        var request = new DispatchWorkflowInstanceRequest(workflowInstanceId);
 013        var options = new DispatchWorkflowOptions();
 14
 015        logger.LogInformation("Restarting workflow {WorkflowInstanceId}", workflowInstanceId);
 016        await workflowDispatcher.DispatchAsync(request, options, cancellationToken);
 017    }
 18}