PowerCenter
- PowerCenter 10.5.1
- All Products
// Initially set generateRow to true for each input row. generateRow = true; // Initially set isRoot to false for each input row. isRoot = false; // 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; } else { // Set the output port values. EMP_ID_OUT = EMP_ID_INP; EMP_NAME_OUT = EMP_NAME_INP; } if (isNull ("EMP_DESC_INP")) { setNull("EMP_DESC_OUT"); } else { EMP_DESC_OUT = EMP_DESC_INP; } boolean isParentEmpIdNull = isNull("EMP_PARENT_EMPID"); if(isParentEmpIdNull) { // This employee is the root for the hierarchy. isRoot = true; logInfo("This is the root for this hierarchy."); setNull("EMP_PARENT_EMPNAME"); } synchronized(lock) { // If the employee is not the root for this hierarchy, get the // corresponding parent id. if(!isParentEmpIdNull) EMP_PARENT_EMPNAME = (String) (empMap.get(new Integer (EMP_PARENT_EMPID))); // Add employee to the map for future reference. empMap.put (new Integer(EMP_ID_INP), EMP_NAME_INP); } // Generate row if generateRow is true. if(generateRow) generateRow();