#1 2012-06-13 10:11:18

Elect2
Member
Registered: 2012-05-29
Posts: 31

External configuration file

Hi people smile

I am wondering is thare any easy way to store job variables (configuration) in external config file, so I'll be able to change (for example) input and output directories, db connections etc. withot changing complete job, just config file.




Regards!

Offline

#2 2012-06-13 10:15:35

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: External configuration file

Hi

You might use the tContextLoad component.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-06-13 11:26:04

Elect2
Member
Registered: 2012-05-29
Posts: 31

Re: External configuration file

I am using this schema

tFileInputDelimited--row11-->tContextLoad--onComponentOk-->MsgBox(context.test)

but I am getting this error 'test cannot be resolved or is not a field'.

In input file I have 3 rows:
test;testing
nTest;nTesting
mTest;mTesting

Offline

#4 2012-06-13 11:28:00

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: External configuration file

Hi

Have you added a context variable called test in your job?
According to the data in delimited file, you need to add three context variables(test, nTest, mTest).

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-06-13 13:41:42

Elect2
Member
Registered: 2012-05-29
Posts: 31

Re: External configuration file

Thank you good sir! You introduced me to the magic world of contexts tongue

Basically, creating a context group, defining few variables and linking context with job is answer for my question. I've just find that exported Talend job keeps context variables in file ~\\talenddemosjava\job_name\contexts\Default.properties which I can change as I wont.



Best regards!

Offline

Board footer

Powered by FluxBB