Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I’ve tried numerous ways to make this work and I’m still lost : (
The 1st subjob hashes out a table that I need the 4th subjob to iterate on each row to call the tRestClient.
The 2nd subjob is just to get the total # of rows from the 1st subjob.
The 3rd subjob just sets the varaible for the loop with the total # of rows. context.rowCount = (Integer)globalMap.get("tHashInput_2_NB_LINE");
I am having errors on the 4th subjob. The loop is ‘For ‘ each rowCount – I want this job to run through every row from the previous job. In this example 678 rows or times.
I have an IF condition for tDie of row28.errorCode>400
It runs 13 times, which is great because those 13 times are errors of 400, but then when I get a good rows of 200, I get error java.lang.NullPointerException: null for tJavaFlex_2
Why is the 200 or successful, going through the error channel?
What am I doing wrong? Please help...I don't know how to make this work.
Hi
The cause is row28.errorCode is null when you get a good row, the condition expression row28.errorCode>400 throws the error. To solve it, change the code on tJavaFlex as below:
System.err.println("ErrorCode: " + row28.errorCode + " ErrorMessage: " + row28.errorMessage);
if(row28.errorCode>400){
context.condition=true;
}else{
context.condition=false;
}
Define a context variable called condition and use it as condition expression of RunIf.
Regards
Shong
Hi
Can you show us the Java code on tJavaFlex?
Regards
Shong
Hi @Shicong Hong, it's just printing the error codes. Here's what I have in tJavaFlex
System.err.println("ErrorCode: " + row28.errorCode + " ErrorMessage: " + row28.errorMessage);
Hi
The cause is row28.errorCode is null when you get a good row, the condition expression row28.errorCode>400 throws the error. To solve it, change the code on tJavaFlex as below:
System.err.println("ErrorCode: " + row28.errorCode + " ErrorMessage: " + row28.errorMessage);
if(row28.errorCode>400){
context.condition=true;
}else{
context.condition=false;
}
Define a context variable called condition and use it as condition expression of RunIf.
Regards
Shong
Thank you @Shicong Hong for the solution. You are the best 😀