Custom component: get current row

Seven Stars

Custom component: get current row

Hello,

 

I am development a custom component for Talend Open Studio. The custom component can have more then one incoming flow. I reveive the incoming Connections with node.getIncomingConnections(EConnectionType.FLOW_MAIN); Thats works.

But If a create a job, I got an error:

row1/row2 not exist. I see in my example (two rowGenerators connect to my custom component) there are two methods:

 

tRowGenerator_1Process/tRowGenerator_2Process. The two method contains my code from the custom component. Thats ok, but because I produce code for all over incoming rows, he also produce code for row2 in tRowGenerator_1Process method and row1 in tRowGenerator_2Process. In method 

tRowGenerator_1Process he not found row2 and in  tRowGenerator_2Process he not found row1.

Can I see what is the current component or method  with his rows? Then can I filter this rows and produce only code for the right method.

 

I only use the _main.javajet

 

Greets

 

Benjamin

 


Accepted Solutions
Seven Stars

Re: Custom component: get current row

ok I have found the solution by my self: over codeGenArgument.getIncomingName() you can get the current row.

View solution in original post


All Replies
Seven Stars

Re: Custom component: get current row

ok I have found the solution by my self: over codeGenArgument.getIncomingName() you can get the current row.

View solution in original post

Highlighted
Moderator

Re: Custom component: get current row

Hi,

Great that you have found the solution by yourself. Please mark your topic as resolved.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now