using Elsa.Expressions.Helpers; using Elsa.Expressions.Models; using Elsa.Extensions; using JetBrains.Annotations; namespace Elsa.Python.Models; /// /// Provides access to the current execution context. /// [UsedImplicitly] public partial class ExecutionContextProxy { /// /// Gets the current execution context. /// public ExpressionExecutionContext ExpressionExecutionContext { get; } /// /// Initializes a new instance of the class. /// public ExecutionContextProxy(ExpressionExecutionContext expressionExecutionContext) { ExpressionExecutionContext = expressionExecutionContext; } /// /// Gets the value of the specified variable. /// public object? GetVariable(Type type, string name) => ExpressionExecutionContext.GetVariableInScope(name).ConvertTo(type); /// /// Sets the value of the specified variable. /// public void SetVariable(string name, object? value) => ExpressionExecutionContext.SetVariable(name, value); }