Use campaign IDs to define context variables and pass them to the Job at
runtime to decide what campaign to populate with your data.
About this task
This procedure explains how to define a
context group and its context variables in the studio repository before importing it to
the
Contexts view of the Job.
Procedure
-
Right-click the Contexts node in the
Repository tree view and select Create
context group from the menu.
-
In the open wizard, enter a name, purpose, and description for
the new context group. Call it CampaignIdContextGroup in this example.
-
Click Next to move to the second step and start defining
the context variables.
A context named Default
is created and set as the
default environment.
-
Click the [+] button below the table and add three lines.
-
Click in the Name fields and enter names for the
variables you are creating, CampaignId_Dev,
CampaignId_QA, and
CampaignId_Prod in this example.
-
Keep the default String type for the three
variables.
-
Click in the Value
fields and enter as quoted text the ID of each of the Dev, QA and Prod campaigns
defined on the Talend Data Stewardship
instance.
Note: You can get the
campaign technical name from the Campaign
ID filed in the Advanced
settings view of the tDatastewardshipTaskOutput component once you connect the
Job to the campaign. Otherwise, you can retrieve it from the campaign URL on
the Talend Data Stewardship instance or
from Talend Data Stewardship REST
API.
-
Click Finish to close
the wizard and create the group under the Contexts node.
-
Open the Contexts view under the Job in the design
workspace.
If you can not see the Contexts
tab, select to open the Contexts view
in Studio.
-
Drop the new group from the Repository
to the Contexts view.