diff --git a/src/modules/Elsa.CSharp/Models/Globals.cs b/src/modules/Elsa.CSharp/Models/Globals.cs index f86b9693d..cc3de6dc2 100644 --- a/src/modules/Elsa.CSharp/Models/Globals.cs +++ b/src/modules/Elsa.CSharp/Models/Globals.cs @@ -1,11 +1,13 @@ using Elsa.Expressions.Models; using Elsa.Extensions; +using JetBrains.Annotations; namespace Elsa.CSharp.Models; /// /// Provides access to global objects, such as the workflow execution context. /// +[UsedImplicitly] public partial class Globals { /// @@ -15,9 +17,9 @@ public partial class Globals { ExpressionExecutionContext = expressionExecutionContext; Arguments = arguments; - ExecutionContext = new ExecutionContextProxy(expressionExecutionContext); - Output = new OutputProxy(expressionExecutionContext); - Outcome = new OutcomeProxy(expressionExecutionContext); + ExecutionContext = new(expressionExecutionContext); + Output = new(expressionExecutionContext); + Outcome = new(expressionExecutionContext); } /// @@ -48,6 +50,15 @@ public partial class Globals get => ExpressionExecutionContext.GetWorkflowExecutionContext().CorrelationId; set => ExpressionExecutionContext.GetWorkflowExecutionContext().CorrelationId = value; } + + /// + /// Gets or sets the name of the current workflow instance. + /// + public string? WorkflowInstanceName + { + get => ExpressionExecutionContext.GetWorkflowExecutionContext().Name; + set => ExpressionExecutionContext.GetWorkflowExecutionContext().Name = value; + } /// /// Gets additional arguments provided by the caller of the evaluator.