Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I just want to do a simple if statement between 2 integers in order to determine the next action : commit or die. But i don't find out how to manage that simple thing...
I use a tDBInput with a select count(*) in order to get my first integer. Then i use a tFixedFlowInput to get the second integer value with this expression ((Integer)globalMap.get("user_customer_NB_LINE_INSERTED")). Now i just need to compare these 2 values, commit if they are equals, die if they are different.
Can someone help me achieve this please ?
I tried using tMap, tFilterRow, RunIf but didn't find the right way...
Thanks,
Guillaume.
My tJavaRow component already containt java system.out.println, that's why you can see some text printed "Before tDie 5414 5414". I display here my two variables and as you can see they are totally equals.
I guess this is and execution order issue because this text, as i writed, should be executed "before tDie" and that's apparently not happening this way. The content of my variables appears after the error message of my tDie component...
I also tried to move the code with my system.out.println inside the tJava component that is just before the tDie one, but after that onSubjobOk link. The result is strictly the same !
Hi,
Could you please share below details?
a) Screen shot of full job flow
b) Screen shot of the if condition you are using for comparison
c) Screen shots of current System Print commands you have given
Warm Regards,
Nikhil Thampi
Here all the screenshots you asked me
Result after running below. As you can see, the execution order seems correct after replacing tDie by tJava. I think the execution order was correct though but the tDie component might disturb the display...
Hi,
I'm back with a "solution" or rather a bypass...
After querying my first database with a select count(*) in order to get the number of rows expected in my second db (after insertions). I use a tMap to store the result of the comparison between my two values (see below).
Then I store this result in a global var (that could have been a context var) and I use it inside my RunIf links to test wether the comparison returned true or false.
This is working well but that's just a bypass. I really think there is a talend issue if I try to do this comparison right inside the RunIf links without doing it before in a tMap as I am doing now.