The initial context load method and the tContextLoad
methods do suffer from having to use a predetermined file location. This exercise shows how it is possible to overcome this via the use of system variables.
Note that this exercise is demonstrated on Microsoft Windows 7; however, it is possible to set and use global environment variables in Talend in any version of Windows, Linux, or Mac OS.
Copy the systemValueContext.txt
file from the cookbook directory/chapter6
to C:\TalendContextDirectory
.
The steps for setting the context file location in the operating system are as follows:
Run the job, and you will notice that the value of the context variable is set to
In the job
.Go to Start | Control Panel | System and Security.
Select System, then click the right-hand side Advanced system settings.
Click on the Environment Variables button.
Under the System variables, click on New.
Enter Variable name as
TALEND_CONTEXT_DIRECTORY...