Pre-Iterate Rule :
# It's used to perform before a Connector iterates on the data
e.g :
# Validating a CSV file to verify that it's in good condition / valid format
# Decrypting/converting a file to another format
e.g: 1
Identity IQ Pre-Iterate Rule to archive CSV file after Aggregation.
import java.io.File;
import java.io.IOException;
import java.io.file.Files;
import java.text.SimpleDateFormat;
import java.util.*;
import org.apache.log4j.Logger;
private static final Logger LOGGER = Logger.getLogger(“PreIterateCSV”);
LOGGER.debug(“Enterting into PreIterateCSV rule : ”);
String fileName=(String)stats.get(“fileName”);
LOGGER.debug(“Filename : “+fileName);
String filePath=(String)stats.get(“absolutePath”);
String timeStamp = new SimpleDateFormat(“yyyyMMdd_HHmmss”).format(Calendar.getInstance().getTime());
File file =new File(filePath);
File newFile =new File(“Location” + fileName.substring(0,fileName.indexOf(‘.’)) +timeStamp+”.csv”);
try {
Files.copy(file.toPath(), newFile.toPath());
LOGGER.debug(“File “+fileName+”is copied to Archive folder”);
} catch (IOException ex)
{
LOGGER.error(“Exception in Pre-Iterate Rule: “+ex.getMessage());
}
--------------------------------------------------********************---------------------------------------------
Map To Resource Object Rule :
# It's available for JDBC and Delimited File Connectors
# It's used for converting Map to Resource Object
# It will run during the Account Aggregations
# Provides a hook to control the map to resource object mapping
--------------------------------------------------********************---------------------------------------------
Post-Iterate Rule :
# It's used to perform duties after a Connector iterates / pulls in data
# It will run during Account Aggregation
# Not required
e.g :
Deleting, moving, or renaming files on the disk for archival storage
No comments:
Post a Comment