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

Testing logic – the most-used pattern

This is probably the most-used job design in Talend programming, and is used to ensure that a snippet of new code is not influenced by external factors within a large and complex job. This simple recipe shows how this can easily be achieved.

Getting ready

Open the jo_cook_ch10_0140_logicTest job.

How to do it...

The steps for testing logic are as follows:

  1. In tFixedFlowInput, tick the box labeled Use Inline Table.
  2. Add the values, as shown in the following screenshot:
    How to do it...
  3. In the tMap, add a new field to the output named ageCheckValid, and populate it with the following code:
    customer.age >= 21 && customer.country.equals("UK") ...

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