Context

Context os Talend’s mechanism for allowing you to specify the run-time parameters of your Jobs.

Your Job runs in a context, for example, Development, Test, UAT, or Production. Within this context, parameter values are specified that are relevant to a specific environment.

In the most part, you can consider Context as being synonymous with Environment.

Talend provides a context named “Default“, with the Framework adding “Dev“, “Test“, “UAT” and “Prod“. You may add your own, if needed. These additional contexts need only be defined for the executable Job (see Template Jobs), with child Jobs always inheriting their context from their parent.

The Framework changes the default Context from “Default” to “Dev“. The Talend Framework uses the Context named “Default” for Framework Testing and templating, as well as providing Context values that are valid across the Organisation, Environments, Projects and Jobs. You can read more about this in the tutorial on Organising your Projects.

Framework Context Groups

The Framework provides you with a number of predefined Framework Context Groups. These allow you to both work with the Framework, and perform common tasks. These values are available in each of your Jobs

Context Files

You specify the runtime parameters of your Job in a Context File. You only need to specify the values that are an exception to any default or inherited values.

The construction of a Context File is similar to that of a traditional INI File.

Context Files may have an hierarchical structure, meaning that you only need to specify exceptions, at lower-levels. This means, for example, that if you have many Jobs that connect to the same Database instance, you need specify the connection details only once. If one of your Jobs is to use a different Username and Password, you may then specify those values for that specific Job, and still inherit the location of the Database from a higher-level Context File. For more information on hierarchical Context Files, read the section Auto-load Context Files in this article on Context Files.

Context Loading

The are a number of ways that Talend allows you to load Context values. The Talend Framework uses a simple, yet powerful, file-based Context Loader.

This Context Loader allows you to perform the minimum of configuration, only needing to specify the exceptions to default values. This greatly simplifies your deployment process, from development through to test and production.

The Framework encourages developers to always use context for parameters, avoiding the pitfalls of having hard-coded parameters within your Jobs.