tFileOutputExcel_1_NB_LINE leads to null pointer exception

One Star

tFileOutputExcel_1_NB_LINE leads to null pointer exception

Hi,
Please refer below my Job design,
tFileinputexcel - tmap - tjava - tfile output excel 1 - email 1 (tFileOutputExcel_1_NB_LINE>1)
tfile output excel 2 - email 2 (tFileOutputExcel_2_NB_LINE returns null)
tfile output excel 3 - email 3 (tFileOutputExcel_3_NB_LINE returns null)
for each output file I need to verify a condition like "((Integer)globalMap.get("tFileOutputExcel_1_NB_LINE")) > 1"
based on the result I need to send a mail to users.
NB_line is work only if my subjob is ok (ie for one condition tfile output excel 1_nb line)
other 2 conditions the line vale return "null" and I am not able to check the conditions.
Please let me know if any other way to check my condition for Email notifications.
Thanks and Regards,
Manikandan.R
One Star

Re: tFileOutputExcel_1_NB_LINE leads to null pointer exception

Hi Manikandan,
use the following code instead:
(globalMap.get("tFileOutputExcel_1_NB_LINE") != null? (Integer)globalMap.get("tFileOutputExcel_1_NB_LINE")) > 1 : false

Bye
Volker

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog