< 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: 20
Uncovered lines: 0
Coverable lines: 20
Total lines: 42
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.Api.Security;
 3using Elsa.Workflows.Management;
 4using Elsa.Workflows.Runtime;
 5using JetBrains.Annotations;
 6
 7namespace Elsa.Workflows.Api.Endpoints.WorkflowDefinitions.Execute;
 8
 9/// <summary>
 10/// An API endpoint that executes a given workflow definition through GET method.
 11/// </summary>
 12[PublicAPI]
 513internal class GetEndpoint(
 514    IWorkflowDefinitionService workflowDefinitionService,
 515    IWorkflowRuntime workflowRuntime,
 516    IWorkflowStarter workflowStarter,
 517    IApiSerializer apiSerializer,
 518    WorkflowDefinitionScriptAuthorizationService scriptAuthorizationService)
 19    : ElsaEndpoint<GetRequest>
 20{
 21    /// <inheritdoc />
 22    public override void Configure()
 23    {
 324        Routes("/workflow-definitions/{definitionId}/execute");
 325        ConfigurePermissions("exec:workflow-definitions");
 326        Verbs(FastEndpoints.Http.GET);
 327    }
 28
 29    /// <inheritdoc />
 30    public override async Task HandleAsync(GetRequest request, CancellationToken cancellationToken)
 31    {
 232        await WorkflowExecutionHelper.ExecuteWorkflowAsync(
 233            request,
 234            workflowDefinitionService,
 235            workflowRuntime,
 236            workflowStarter,
 237            apiSerializer,
 238            scriptAuthorizationService,
 239            HttpContext,
 240            cancellationToken);
 241    }
 42}