From 0bf562f72c4ecc6a7c0e6eabf2e93d1a8d48bffb Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 28 Dec 2023 14:18:07 +0100 Subject: [PATCH] Add non-generic GetVariable method and Python accessors A non-generic version of GetVariable method has been added to the ExecutionContextProxy.cs, allowing direct access to variables without specifying a type. To leverage this, Python accessors for getting and setting workflow variables have been added to GenerateWorkflowVariableAccessors.cs. This enhances the interaction between the Python scripts and the context variables. --- .../Handlers/GenerateWorkflowVariableAccessors.cs | 6 ++++++ src/modules/Elsa.Python/Models/ExecutionContextProxy.cs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/modules/Elsa.Python/Handlers/GenerateWorkflowVariableAccessors.cs b/src/modules/Elsa.Python/Handlers/GenerateWorkflowVariableAccessors.cs index 4301a7814..1ee0dc362 100644 --- a/src/modules/Elsa.Python/Handlers/GenerateWorkflowVariableAccessors.cs +++ b/src/modules/Elsa.Python/Handlers/GenerateWorkflowVariableAccessors.cs @@ -23,6 +23,12 @@ public class GenerateWorkflowVariableAccessors : INotificationHandler public object? GetVariable(string name) => ExpressionExecutionContext.GetVariableInScope(name).ConvertTo(); + + /// + /// Gets the value of the specified variable. + /// + public object? GetVariable(string name) => ExpressionExecutionContext.GetVariableInScope(name); /// /// Sets the value of the specified variable.