How to get the current active context name ?

One Star

How to get the current active context name ?

Hi guys,
I need to make a distinction depending on the active context.
In "Default" i need to run a special job whereas in "Production" and "Test" context i don't have to.
Is there a way to deal with that, a way to retrieve the current or active context name ?
Thanks in advance,
Highlighted
Two Stars

Re: How to get the current active context name ?

Hi gavelin,
In Java, try contextStr.equals("Default").
Cheers,
c0utta
Community Manager

Re: How to get the current active context name ?

Hello
Is there a way to deal with that, a way to retrieve the current or active context name ?

Yes, there is a variable store the currnet context name
System.out.println(contextStr);

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: How to get the current active context name ?

Does anyone know how to access contextStr in e.g. the properties for a component such as tFileCopy?

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download