从你的问题的内容,我会改写主题
“如何在 Talend Open Studio Data Integration 作业中读取和使用外部属性文件?”
首先...创建您的属性文件“common.properties”。您可以将其放入(例如)/etc/classpath 或 c:\etc\classpath
属性文件的示例内容
example_property="This is an example property"
在 Talend Project 中创建一个公共上下文并将相同的属性添加到该上下文中
创建一个可重复使用的作业来读取属性并加载它们。我们称之为 Read_Properties。
使用 tFileInputDelimited 组件来读取 props 文件。它应该使用“=”作为行分隔符。
它应该有一个包含两列的架构
key, string
value, string
输出应该去一个 tBufferOutput
现在...保存那个可重复使用的工作。
创建一个新作业,example_calling_job。
该作业应使用通用上下文。
该作业应该有一个预作业步骤,使用 tRunJob 调用属性作业,将行输出发送到 tContextLoad
然后,您在 example_calling_job 中的组件可以使用属性读取器作业加载的上下文变量。
运行 example_calling_job。 tJava 组件写出 context.example_property 值,该值由属性读取器作业加载到上下文变量中。
Starting job example_calling_job at 11:35 02/03/2016.
[statistics] connecting to socket on port 3497
[statistics] connected
This is an example property.
[statistics] disconnected
Job example_calling_job ended at 11:35 02/03/2016. [exit code=0]