文件位置:

$KETTLE_HOME/samples/transformations/data-generator/JavaScript - Access environment variables.ktr

组件1:Generate Rows

生成10行,没有列

组件2:Java Script Value

getVariable(strVarName, "")和setVariable(strVarName,strVarValue, "r")是一对,右键-点击sample便可以看到方法的说明和用法

这两个方法也有对应的组件,其中type参数表示设置变量的作用范围

system:Valid in the Java Virtual Machine

root:Valid in the root job

parent:Valid in the root job

grandparent:Valid in the grand-parent job

详细解释::

更多推荐

kettle组件javaScript脚本案例2 设置变量和获取变量