User-defined parameters are supplied to your Job during runtime, and this is known as "context." During the promotion of your job from development to test and production, the values of context variables may change. We've outlined the steps for building and adding a Context Group to your Talend job.
A context group is a set of (usually) related context variables for use within a project. This recipe shows how to create a new context group.
If you would like to Enrich your career with a Talend certified professional, then visit Mindmajix - A Global online training platform: “Talend Online Training” Course. This course will help you to achieve excellence in this domain.
How to accomplish it…
The steps for creating a context group are as follows:
How it works…
The context group is created in the metadata panel, and the individual context variables can then be added, along with their default values. Because we chose the type as the Directory, Talend gives us the option of using a windows dialogue to simplify the mechanism for selecting the directory we wish to use.
------ Related Page: Using tContextLoad and Implicit Context Loading to Load Contexts in Talend ------
In this recipe, we have created a basic context, but there are more features that you can explore.
The context dialogue allows many different types of context variables to be defined, and in some cases, as in this recipe, it will provide a dialogue to make definition easier.
Prompt for variable values using the tree mode
Updating values in the context group can also be done in the tree mode. This is an alternative method that differs in one important way.
The tree mode provides an option that will prompt for a value to be displayed at runtime, by checking the prompt box for a variable.
The prompt will appear at runtime, as shown in the following screenshot, and is a useful means for providing test values when developing a job:
A job will not automatically use a CONTEXT GROUP. This exercise shows how to add a context group to a job.
Open the jo_cook_ch06_0010_addContextGroup job.
How to achieve it…
The steps for adding a context group to your job are as follows:
How it works…
The context dialogue within a job allows single (in the job) contexts, as well as context groups, to be added to a job.
The preceding method shows how to add all context variables into a job. There is also an option to add only a subset of the variables within the group, if you drill down into the context group when selecting, demonstrated as follows:
Another method of adding the context to the job from the metadata is to drag the context metadata icon in the Contexts panel.
Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!
|Talend Training||Dec 09 to Dec 24||View Details|
|Talend Training||Dec 12 to Dec 27||View Details|
|Talend Training||Dec 16 to Dec 31||View Details|
|Talend Training||Dec 19 to Jan 03||View Details|
Ravindra Savaram is a Technical Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.
Copyright © 2013 - 2023 MindMajix Technologies