Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
rgranado
Contributor III
Contributor III

Dynamic context variable when promoting jobs in TIC

Hello,

I need help on a solution regarding dynamic context variable when promoting jobs from one environment to another in the cloud (TIC).  There is a functionality in TAC but according to Talend Support there is no functionality in TIC currently.

Is there a java code that I could use and plug-in to tjava that would:

  • check the TIC environment (for example: test environment, promotion pipeline dev -> test)
  • then based on the TIC environment, use the proper context variable set for that environment

Greatly appreciate any help on this.

 

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

I haven't tried this, so this is suggestion I *think* might work. Have you every used the implicit context load? If not, check it out here (https://help.talend.com/reader/mhqCkTBnin7IXmJBUJoocQ/0lPtF5eayDI~33QdLfRY~A).

 

I currently use this in a way that is different from a lot people. The context load parameters (for both pointing to a file or a database) are able to be used to call methods. Those that are expecting a String can actually run a routine which returns a String. As such, you can return a configuration which will dynamically point your job to a file or a database table. You can make use of simple Java to return operating system environment variables to identify which environment you are in, then from that return values that point you to a file with contexts in or a database with contexts in.


As I said, I have not tried this in TIC, but it works in both the open source edition and the enterprise edition. It is actually a pretty powerful way of dealing with contexts.

Give it a try and let me know if it works

View solution in original post

5 Replies
Anonymous
Not applicable

I haven't tried this, so this is suggestion I *think* might work. Have you every used the implicit context load? If not, check it out here (https://help.talend.com/reader/mhqCkTBnin7IXmJBUJoocQ/0lPtF5eayDI~33QdLfRY~A).

 

I currently use this in a way that is different from a lot people. The context load parameters (for both pointing to a file or a database) are able to be used to call methods. Those that are expecting a String can actually run a routine which returns a String. As such, you can return a configuration which will dynamically point your job to a file or a database table. You can make use of simple Java to return operating system environment variables to identify which environment you are in, then from that return values that point you to a file with contexts in or a database with contexts in.


As I said, I have not tried this in TIC, but it works in both the open source edition and the enterprise edition. It is actually a pretty powerful way of dealing with contexts.

Give it a try and let me know if it works

rgranado
Contributor III
Contributor III
Author

Thank  you.  I will try it out.

rgranado
Contributor III
Contributor III
Author

Hi,

 

Thank you.  This has worked for me.

 

 

Anonymous
Not applicable

Pleased to hear it. Maybe support need to be told that it works 🙂

rgranado
Contributor III
Contributor III
Author

I just told them.

It seems like TIC is missing quite a lot of functionalities. I put the solution you suggested in a Joblet; set it as "Startable"; Successfully run on my local machine but once I ran it on TIC, the "Startable" functionality does not work.

Thanks for your help.