hop
hop copied to clipboard
[Bug]: Getting variables in Javascript does not interpret nested variables
Apache Hop version?
2.8.0 (2024-02-28 03.31.08)
Java version?
java.version=11.0.22
Operating system
Windows
What happened?
Scenario: in the environment you have a variable that has another variable inside its definition. For example the variable "tmp.dir" is defined as "${PROJECT_HOME}/tmp". When you get the variable using transform "Get variables" you will have, for example, "some_path/Hop/Use_cases/tmp". If you do the same using the function getVariable() inside a Javascript transform you will have "${PROJECT_HOME}/tmp". IT seems the getVariable is not decoding the nested variable value. There is the same difference also in case you use in the environment a previous variable inside another one (someting like log.dir=${tmp.dir}/log. Please find attached a pipeline and an environment file as example.
use_cases_env.json javascript_nested_variables.zip
Issue Priority
Priority: 2
Issue Component
Component: Transforms