Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to raise an exception (Fail the job) within a tJava component, and want to know if this is possible.
I understand a solution to this would be to have a If statement connection to a tDie, however i am trying to get the below working.
context.Count1=Integer.parseInt(((String)globalMap.get("total")));
System.out.println(context.Count1);
context.Count2=(((Integer)globalMap.get("tFileRowCount_1_COUNT"))-1);
System.out.println(context.Count2);
if (context.Count2.equals(context.Count1))
{
System.out.println("The number's match");
}
else
{
System.out.println("The number's don't match");
throw new Exception;
}
Is this possible? To raise throw an exception inside of the Java code?
Thank you
Hello,
You can use tJava component to make the if else statement exit the job.
Here is a related topic:https://community.talend.com/t5/Design-and-Development/tJava-IF-ELSE-statement-fails/m-p/38949
Let us know if it is OK with you.
Best regards
Sabrina
Hello,
You can use tJava component to make the if else statement exit the job.
Here is a related topic:https://community.talend.com/t5/Design-and-Development/tJava-IF-ELSE-statement-fails/m-p/38949
Let us know if it is OK with you.
Best regards
Sabrina
Is it not possible to force the end of a subjob in a tJava without exiting the entire job?
My goal is to have the rest of the job run even if some of the subjobs have errors.
@shongYou are saying I need to save each subjob as its own job? So I will end up having 20 different jobs?
Why doesn't Talend add a function similar to System.Exit that only breaks out of the current subjob? Something like System.SubExit