As per my requirement i have added 2 context groups in my job. Attached is the screenshot of my job.
Context group names are DBConnection and SourceConnection.
My requirement is to get those group names and display on console. Is there any way to get Only context group names in Talend?
Please help me.
I'm afraid this is not possible.
As far as I know, context groups are here just to let you organize context variables into the Studio.
As a workaround you could make another context group called "ContextGroups", with a variable called "ContextGroupsList". You could put your context group names in the list and then display the list on the console.
As TRF said, no but maybe you could prefix your context variable names with the name of the context group? Like:
Context group DBConnection
Context group SourceConnection
This would work as you can use java reflection to read your variable names, and strip everything after the first underscore...
No. But you really have me curious about the use case here. What are you trying to do? What purpose does printing the context group names in the console serve? With more information we could suggest another approach?
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Pick up some tips and tricks with Context Variables