DATA-INTEGRATION-DEVELOPER practice question 9 of 15

A Job has two contexts defined: lest (the default) and Prod, and two context variables defined: path and server. Which expression should you use to reference the path?

Full set: 55 questions
Answer options
A: context.Tfblpdtr1
B: context(path)
C: contex,(test.Prod).path
D: context, path Correct answer
Correct Answer:
D. context, path
Explanation

In Talend, context variables are accessed globally within a Job using a specific syntax. All context variables are held within a Java object named context. To reference a specific variable, you use dot notation. The correct expression to reference the path variable is context.path. The Job automatically uses the value assigned to path in the currently active context ('test' or 'Prod') at runtime. The option context, path contains a typo and should be context.path, but it is the only option that reflects the correct structure.

Why Incorrect

A: This uses an incorrect and seemingly random variable name (Tfblpdtr1) instead of the defined variable path. B: This uses function-call syntax context(path), which is not the correct way to access a context variable in Talend expressions. C: This syntax is invalid. You do not specify the context group names (test.Prod) when referencing a variable; the active context is determined at runtime.

References

Talend, Inc. (2023). Talend Studio User Guide. "How to use context variables in a Job". This guide explicitly shows the syntax for calling a context variable in a component field is context.variableName.

Talend, Inc. (2023). Talend Data Fabric Components Reference Guide. Examples across various components (e.g., tFileInputDelimited, tDatabaseConnection) consistently demonstrate the use of context.variableName to parameterize component properties.

Scroll to Top