< Summary

Information
Class: Elsa.Workflows.Api.Endpoints.WorkflowDefinitions.Execute.GetEndpoint
Assembly: Elsa.Workflows.Api
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/Execute/GetEndpoint.cs
Line coverage
100%
Covered lines: 18
Uncovered lines: 0
Coverable lines: 18
Total lines: 39
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%
Configure()100%11100%
HandleAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/Execute/GetEndpoint.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Workflows.Management;
 3using Elsa.Workflows.Runtime;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Workflows.Api.Endpoints.WorkflowDefinitions.Execute;
 7
 8/// <summary>
 9/// An API endpoint that executes a given workflow definition through GET method.
 10/// </summary>
 11[PublicAPI]
 312internal class GetEndpoint(
 313    IWorkflowDefinitionService workflowDefinitionService,
 314    IWorkflowRuntime workflowRuntime,
 315    IWorkflowStarter workflowStarter,
 316    IApiSerializer apiSerializer)
 17    : ElsaEndpoint<GetRequest>
 18{
 19    /// <inheritdoc />
 20    public override void Configure()
 21    {
 122        Routes("/workflow-definitions/{definitionId}/execute");
 123        ConfigurePermissions("exec:workflow-definitions");
 124        Verbs(FastEndpoints.Http.GET);
 125    }
 26
 27    /// <inheritdoc />
 28    public override async Task HandleAsync(GetRequest request, CancellationToken cancellationToken)
 29    {
 230        await WorkflowExecutionHelper.ExecuteWorkflowAsync(
 231            request,
 232            workflowDefinitionService,
 233            workflowRuntime,
 234            workflowStarter,
 235            apiSerializer,
 236            HttpContext,
 237            cancellationToken);
 238    }
 39}