Tuesday, May 5, 2015

What is Context and Global Map in Talend !!

Context:---

Context describes the user-defined parameters that are passed to your Job at runtime. 

Context variables are parameters that Talend uses, that can be set to different values in different environments.
Context Variables are the the values that may change as you promote your Job from Development, through to Test and Production. Values may also change as your environment changes, for example, passwords may change from time to time.

Use of Contexts in Talend:---
When developing jobs in Talend, it’s sometimes necessary to run them on different environments. For other business cases, you need to pass values between multiple sub-jobs in a project. To solve this kind of issues, Talend introduced the notion of “contexts”.

Common values in contexts
Use of context variables is to define values that are commonly used within a project, such as data inbox directory, staging area directory, and constants.

Passing command line parameters
Context variables are also used to pass parameters to a job, either via the command line or from a calling a (parent) job. 

Setting context variables in the code 
The ability to manipulate context variables within the code .


Database context variables 
Creating a context group for database connections .

Global Map:----

Talend provides the globalMap Object where both Talend and you can store and retrieve data. This is a great place to create your global variables as well as retrieving important information about your executing Job.

Differnce between Context and Global Map:--

These are global areas used to store data that can be used by all components within a Talend job.
Context variables are predefined prior to job execution in a context group whereas Global Map variables are created on the fly at any point within a job.

No comments:

Post a Comment