Gathering all rejects prior to killing a job
As an alternative to collecting incorrect rows up to the point where a job fails (Die on error), you may wish to capture all rejects from an input before killing a job.
This has the advantage of enabling support personnel to identify all problems with source data in a single pass, rather than having to re-execute a job continually to find and fix a single error / set of errors at a time.
Getting ready
Open the job
jo_cook_ch03_0010_validationSubjob
. As you can see, the reject flow has been attached and the output is being sent to a temporary store (tHashMap
).
How to do it…
Add the
tJava
,tDie
,tHashInput
, andtFileOutputDelimited
components.Add
onSubjobOk
totJava
from thetFileInputDelimited
component.Add a flow from the
tHashInput
component to thetFileOutputDelimited
component.Right-click the
tJava
component, select Trigger and then Runif. Link the trigger to thetDie
component. Click the if link, and add the following code((Integer)globalMap.get...