< Summary

Information
Class: Elsa.Expressions.CSharp.Models.Globals
Assembly: Elsa.Expressions.CSharp
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/Models/Globals.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 17
Coverable lines: 17
Total lines: 69
Line coverage: 0%
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%210%
get_Outcome()100%210%
get_Output()100%210%
get_ExecutionContext()100%210%
get_WorkflowInstanceId()100%210%
get_CorrelationId()100%210%
set_CorrelationId(...)100%210%
get_WorkflowInstanceName()100%210%
set_WorkflowInstanceName(...)100%210%
get_Arguments()100%210%
get_ExpressionExecutionContext()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/Models/Globals.cs

#LineLine coverage
 1using Elsa.Expressions.Models;
 2using Elsa.Extensions;
 3using JetBrains.Annotations;
 4
 5namespace Elsa.Expressions.CSharp.Models;
 6
 7/// <summary>
 8/// Provides access to global objects, such as the workflow execution context.
 9/// </summary>
 10[UsedImplicitly]
 11public partial class Globals
 12{
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="Globals"/> class.
 15    /// </summary>
 016    public Globals(ExpressionExecutionContext expressionExecutionContext, IDictionary<string, object> arguments)
 17    {
 018        ExpressionExecutionContext = expressionExecutionContext;
 019        Arguments = arguments;
 020        ExecutionContext = new(expressionExecutionContext);
 021        Output = new(expressionExecutionContext);
 022        Outcome = new(expressionExecutionContext);
 023    }
 24
 25    /// <summary>
 26    /// Provides access to activity outcomes.
 27    /// </summary>
 028    public OutcomeProxy Outcome { get; set; }
 29
 30    /// <summary>
 31    /// Provides access to activity outputs.
 32    /// </summary>
 033    public OutputProxy Output { get; set; }
 34
 35    /// <summary>
 36    /// Gets the current execution context.
 37    /// </summary>
 038    public ExecutionContextProxy ExecutionContext { get; }
 39
 40    /// <summary>
 41    /// Gets the ID of the current workflow instance.
 42    /// </summary>
 043    public string WorkflowInstanceId => ExpressionExecutionContext.GetWorkflowExecutionContext().Id;
 44
 45    /// <summary>
 46    /// Gets or sets the correlation ID of the current workflow instance.
 47    /// </summary>
 48    public string? CorrelationId
 49    {
 050        get => ExpressionExecutionContext.GetWorkflowExecutionContext().CorrelationId;
 051        set => ExpressionExecutionContext.GetWorkflowExecutionContext().CorrelationId = value;
 52    }
 53
 54    /// <summary>
 55    /// Gets or sets the name of the current workflow instance.
 56    /// </summary>
 57    public string? WorkflowInstanceName
 58    {
 059        get => ExpressionExecutionContext.GetWorkflowExecutionContext().Name;
 060        set => ExpressionExecutionContext.GetWorkflowExecutionContext().Name = value;
 61    }
 62
 63    /// <summary>
 64    /// Gets additional arguments provided by the caller of the evaluator.
 65    /// </summary>
 066    public IDictionary<string, object> Arguments { get; }
 67
 068    private ExpressionExecutionContext ExpressionExecutionContext { get; }
 69}