-
Book Overview & Buying
-
Table Of Contents
Talend Open Studio Cookbook
By :
This recipe shows how tMap can be used to ensure that unwanted rows are not propagated downstream. This may be as a result of the filter criteria or a validation rule.
Open the job jo_cook_ch03_0030_tMapRejects.
Open the tMap and click the Activate/unactivate expression filter button for the validRows output.
In the Expression box add the code customer.age >= 18.

Click on the tMapRejects output and then on the tMapSettings button.
Click on Catch output reject value column to set it to true.

Run the job. You should see that one of the rows has been rejected.
In this example, tMap is working like an if statement. Therefore, if customer's age is greater than eighteen, then write the record to validRows or else pass the data to the tMapRejects.
You can use this method to test for multiple different rejects, by adding additional outputs and adding different filter criteria to each output.
The tMap component will process any...