How to get an instence of a component in tjava

Four Stars

How to get an instence of a component in tjava

I want ask if there is way to get an instance of a component if a job(ex:tmap , tmysqlinput) in tjava code and then manipulate it manually using code 

Help please

Fifteen Stars TRF
Fifteen Stars

Re: How to get an instence of a component in tjava

Very hazardous. Looking at the generated Java code will give you some answers (I think so).
In fact, accessing to some objects properties is possible (there is blogs and articles about this) but changing anything seems to be dangerous (IMHO).

TRF
Four Stars

Re: How to get an instence of a component in tjava

hi TRF 

thank you again for your answer

would you mind giving me some example or links on how can i access to object properties

actually i want to find a way on how can i add with javacode some column to a csv file structure

thank you

Fifteen Stars TRF
Fifteen Stars

Re: How to get an instence of a component in tjava

Well, I don't want give you bad information regarding this little bit tricky subject.

May be a guy as @rhall_2_0 can give you good directions or advices.

Also Bekwam's blog may help you.

 

Regards,

 


TRF
Community Manager

Re: How to get an instence of a component in tjava

You don't have total control over other components at runtime, but you can take some control. An example of this is switching Connections (DB and FTP, for example) at runtime. This tutorial shows how this is achieved by using Java (https://www.rilhia.com/quicktips/quick-tip-dynamically-change-db-connection). As @TRF suggests, it is not necessarily the safest thing to be trying. But sometimes it can actually be quite useful. However this is not really documented anywhere and would probably be considered "hacking". Remember to look at the code that is generated. If you can read Java, you will learn a lot. 

Four Stars

Re: How to get an instence of a component in tjava

rhall2_0

thank you very much for your explanation

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

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

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch