Two Stars

[resolved] Abort a job

I need to abort the job if any row in an excel file contains null. Basically I have a input file with 3 columns. My requirement is that if any of the 3 fields contain null then the job should abort.
How do I achieve this.
1 ACCEPTED SOLUTION

Accepted Solutions
Two Stars

Re: [resolved] Abort a job

Sorry for the late response as I was travelling.
I basically wrote the records in a file where any of the fields were null and then checked for the record count in the file and aborted the process accordingly.
10 REPLIES
Two Stars

Re: [resolved] Abort a job

I actually had this condition in my tMap and I was expecting it to fail automatically when the field value was Null but to my surprise it did not.
row2.Category.equals("Transfer to Self") ||row2.Category.equals("Fixed") || row2.Category.equals("Credit")?"0":"1"
Moderator

Re: [resolved] Abort a job

Hi,
The expression in tMap should be
Condition?value if true: value if false

.
Are you looking for
row2.Category==null || row2.Category.isEmpty())?"1":"0"

.
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.
Two Stars

Re: [resolved] Abort a job

No I am not looking to bypass the Null or Empty condition. I want to actually abort the job itself as I need to then manually correct the file and then reprocess it again.
This is something that I amlooking into
row2.Category==null || row2.Category.isEmpty())?Abort the ProcessSmiley Frustratedubsequent conditions
Two Stars

Re: [resolved] Abort a job

Any suggestions please ???!!!!
Six Stars

Re: [resolved] Abort a job

Hi,
do you need to abort the job immediately?
If you don't, you can write rows that contain null values to a reject flow (out of tMap). Thus you can abort job if number of rows in reject file is >0.
Two Stars

Re: [resolved] Abort a job

I wanted to avoid this option but if there is no other way then possibly will have to go this route.
Seventeen Stars

Re: [resolved] Abort a job

hi all
use if condition that check number of row in the flow
tDie if == 0 , something else if not.
((Integer)globalMap.get("tLogRow_1_NB_LINE")) == 0

ps : in advanced setting of tDie you've got an option permiting to stop the job immedialtly
regards
laurent
Four Stars

Re: [resolved] Abort a job

That option is called Exit JVM.
Vaibhav
Moderator

Re: [resolved] Abort a job

Hi sunbaj,
Is there any update for your issue?
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.
Two Stars

Re: [resolved] Abort a job

Sorry for the late response as I was travelling.
I basically wrote the records in a file where any of the fields were null and then checked for the record count in the file and aborted the process accordingly.