Context variables are useful items when you have specific variables to be used in different environments, or want to have a job that adapts to a lot of different situations. Sometimes you want to be sure to record all that information and dump it to be viewed. That what the tContextDump component exists for.
Step 1: Set up In-Job Context Variables
Though you can import existing context groups, let’s assume you don’t have any context groups. Open the Contexts tab and use the green plus to add four new variables, naming them whatever you’d like, but change the type of at least one to password.
Within the Contexts tab, switch to the inner tab labeled “Values as table” and enter values for all the different variables. Notice that for the variable you decided was a password, it will hide the value.
Step 2: Setup the components
Chances are, you will normally include more than the ContextDump component, but for this job, all you will need is it and a tLogRow component. Connect them with a main row.
Next, open the Components tab and select the ContextDump component on your canvas. There is only one option “Hide Password”, so go ahead and select it. While you are here, it is worth looking at the schema and seeing that it only has two columns of information: key and value. Key will be the name of the variables, and value is as its name implies–the value.
Step 3: Run the Job
Go ahead and run the job, and see how the output comes out. The password is still hidden, and everything else is visible.
The best uses for this component are to output saved data and then feed them into row information as is to be recorded with whatever data they helped to generate (assuming your talend job consistently uses different variables when it runs). Else, it may just be easier to directly call the context variables as you see fit.