How to pass a context parameter to a subjob on Component error

One Star

How to pass a context parameter to a subjob on Component error

Hi
I've uploaded the screenshot of a sample job that I've created.
In this scenario, on an error occuring in any component in the job, it will go to subjob1 (tRunJob1). The problem is that I want to pass a value that I've retrieved from database.
Say I queried 10 rows and row 5 caused the error. So I want to pass the id of this row5 to subjob1 so that it can use this id to do some roll backs.
Ive tried adding a context variable in subjob1. And in the main job I've tried to pass it as row1.id , but an error occurs stating "row1 not found". Since the main flow doesn't include subjob1, this is logically correct.
Can some one please enlighten me on a method by which I can pass some parameter from the mail flow to the error flow?
I've tried tJavaRow and tJava components. They don't work. I can't access row1.id in the Java component also (Otherwise I could have set some global context variable and passed it via that)
One Star

Re: How to pass a context parameter to a subjob on Component error

A little help?
Community Manager

Re: How to pass a context parameter to a subjob on Component error

Hello
First, define a context var errorID in the father job, use tJavaRow to replace tJava component.
on tJavaRow:
context.errorID=input_row.id
then, pass the value of errorID to child job via tRunJob_1, see 1654.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business