Six Stars

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Fifteen Stars

Re: Dynamic context variable when promoting jobs in TIC

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

Rilhia Solutions
5 REPLIES
Fifteen Stars

Re: Dynamic context variable when promoting jobs in TIC

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

Rilhia Solutions
Six Stars

Re: Dynamic context variable when promoting jobs in TIC

Thank  you.  I will try it out.

Six Stars

Re: Dynamic context variable when promoting jobs in TIC

Hi,

 

Thank you.  This has worked for me.

 

 

Fifteen Stars

Re: Dynamic context variable when promoting jobs in TIC

Pleased to hear it. Maybe support need to be told that it works :-)

Rilhia Solutions
Six Stars

Re: Dynamic context variable when promoting jobs in TIC

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.