Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a few values that persist across jobs... or at least their need does. In Talend, how can I make a project level value that can be called by any job that needs it?
eg. bob = "some guid value based on a subscription"
I need bob's value every time I call an api to bob's api list. And bob has a lot of apis! If my subscription changes, then I have to update every flow where bob's guid value is used.
I can confirm that context once created from the context category (on the left side of the designer) are available from any job.
Here is a screenshot (sorry if it's in french)
This is below the job list. Create a context group and you can use everywhere in your projetct.
- Quentin.
Hello @pthomas
For that use I recommend the use of context variable ! On the left side of the Talend Designer, there is a category called "contexts"
Create a new context with your needs.
For example a context_api with variable such has "url".
When needed just import the context from the context tab below the designer and call it in your components with the value context.context_api_url like this :
- Quentin
Context vars seem to only exist within a job. Is there anything that can be written once and used in many jobs?
I can confirm that context once created from the context category (on the left side of the designer) are available from any job.
Here is a screenshot (sorry if it's in french)
This is below the job list. Create a context group and you can use everywhere in your projetct.
- Quentin.
Got it thanks. I've seen context within a job but missed the left side folder.
So creating a context on the left, I can then add that to context each job in the "job context" and only have to change a value in 1 place.
Yes, exactly.
For example we use context for an API call to create a ticket if the job failed.
Since this API call is in every job we needed to add it to a context and if it change we only have to edit the context, all of the jobs will then use the new values of the context.
- Quentin