O'Reilly logo

Talend Open Studio Cookbook by Rick Barton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Killing a job from within tJavaRow

Most jobs at some point require validation and will often need to be stopped if the data is found to be in error. In most cases, you can use tDie, however, if your error is found in a tJavaRow or tJava, then using tDie becomes quite convoluted. This exercise shows how the same results can be achieved using simple Java functionality.

Getting ready

Open the jo_cook_ch10_0150_killingJobtJavaRow job.

How to do it...

The steps for killing a job from within tJavaRow are as follows:

  1. Run the job. You will see that it fails with a null pointer exception.
  2. Change the line output_row.age = input_row.age; to the following code:
    if (input.age == null) { System.out.println("Fatal Error: age is null"); System.exit(99); } else { output_row.age ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required