< Summary

Information
Class: Elsa.AI.Host.Context.WorkflowDefinitionContextProvider
Assembly: Elsa.AI.Host
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Host/Context/WorkflowDefinitionContextProvider.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 29
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
get_Kind()100%11100%
ResolveAsync(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Host/Context/WorkflowDefinitionContextProvider.cs

#LineLine coverage
 1using Elsa.AI.Abstractions.Contracts;
 2using Elsa.AI.Abstractions.Models;
 3
 4namespace Elsa.AI.Host.Context;
 5
 6/// <summary>
 7/// Placeholder workflow definition context provider. Replace this implementation with a workflow-management-backed reso
 8/// </summary>
 9public class WorkflowDefinitionContextProvider : IAIContextProvider, IPlaceholderAIContextProvider
 10{
 4411    public string Kind => "WorkflowDefinition";
 12
 13    public ValueTask<AIResolvedContext> ResolveAsync(AIContextResolutionRequest request, CancellationToken cancellationT
 14    {
 115        var attachment = request.Attachment;
 16
 117        return ValueTask.FromResult(new AIResolvedContext
 118        {
 119            Kind = Kind,
 120            ReferenceId = attachment.ReferenceId,
 121            Summary = $"Workflow definition context provider is not implemented; only reference {attachment.ReferenceId}
 122            Data = [],
 123            Metadata = new JsonObject
 124            {
 125                ["activityId"] = attachment.ActivityId
 126            }
 127        });
 28    }
 29}