Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have used tjavaflex to get source and target count values. There is two flow to target table insert and update.
I wrote the code to get the sum of two flows:
row4.targetcount=Integer.sum((Integer)globalMap.get("tDBOutput_1_NB_LINE"),(Integer)globalMap.get("tDBOutput_2_NB_LINE"));
when I run the job, it is throwing the following exception,
Exception in component tJavaFlex_1 (demo)
java.lang.NullPointerException
at case_study_etl_process.demo_0_1.demo.tStatCatcher_1Process(demo.java:5756)
at case_study_etl_process.demo_0_1.demo.tPrejob_1Process(demo.java:4668)
at case_study_etl_process.demo_0_1.demo.runJobInTOS(demo.java:6118)
at case_study_etl_process.demo_0_1.demo.main(demo.java:5916)
Exception in component tJavaFlex_1 (demo)
java.lang.NullPointerException
at case_study_etl_process.demo_0_1.demo.tStatCatcher_1Process(demo.java:5756)
at case_study_etl_process.demo_0_1.demo.runJobInTOS(demo.java:6130)
at case_study_etl_process.demo_0_1.demo.main(demo.java:5916)
Exception in component tJavaFlex_1 (demo)
java.lang.NullPointerException
at case_study_etl_process.demo_0_1.demo.tStatCatcher_1Process(demo.java:5756)
at case_study_etl_process.demo_0_1.demo.runJobInTOS(demo.java:6164)
at case_study_etl_process.demo_0_1.demo.main(demo.java:5916)
@Shalini M , as per error you are getting null values for (Integer)globalMap.get("tDBOutput_1_NB_LINE") or (Integer)globalMap.get("tDBOutput_2_NB_LINE")
you need to handle null values.can you try to write below way and see.
row4.targetcount=Integer.sum(((Integer)globalMap.get("tDBOutput_1_NB_LINE")==null?0:(Integer)globalMap.get("tDBOutput_1_NB_LINE")),(Integer)globalMap.get("tDBOutput_2_NB_LINE")==null?0:(Integer)globalMap.get("tDBOutput_2_NB_LINE")));
Thanks,
Manohar
@Shalini M , as per error you are getting null values for (Integer)globalMap.get("tDBOutput_1_NB_LINE") or (Integer)globalMap.get("tDBOutput_2_NB_LINE")
you need to handle null values.can you try to write below way and see.
row4.targetcount=Integer.sum(((Integer)globalMap.get("tDBOutput_1_NB_LINE")==null?0:(Integer)globalMap.get("tDBOutput_1_NB_LINE")),(Integer)globalMap.get("tDBOutput_2_NB_LINE")==null?0:(Integer)globalMap.get("tDBOutput_2_NB_LINE")));
Thanks,
Manohar
Thank you @Manohar B It worked! 😊
@Shalini M ,glad to help you