incrementErrorCount
Increments the error count. If the error count reaches the error threshold, the mapping fails.
Use the following syntax:
incrementErrorCount(int nErrors);
The following table describes the parameter:
Parameter | Parameter Type | Datatype | Description |
---|
nErrors | Input | Integer | Number by which to increment the error count. |
You can add the incrementErrorCount method to the Java code on any code entry tab except the Imports and Functions tabs.
The following Java code shows how to increment the error count if an input port for a transformation has a null value:
// Check if input employee id and name is null.
if (isNull ("EMP_ID_INP") || isNull ("EMP_NAME_INP"))
{
incrementErrorCount(1);
// if input employee id and/or name is null, don't generate a output row for this input row
generateRow = false;
}