I have a basic synchronization project to import a bunch of CSV files. The data I would like to import in One Identity Manager looks like this :
code2; ; ;valueC2
Basically I want to make sure there is not empty value in the line before importing it. Otherwise, I would like to skip this line and generate an error in the log of synchronization project (in this example, line 3 and line 2, would be skipped).
How can I generate an error and then skip the line in one the columns is empty?
You could try to create a scope that checks each of your column against an empty value. To avoid to import empty lines.
But you cannot throw custom error messages in that case.
I think you need to pre-process your CSV file in a custom process prior to importing it.
I really need these empty lines to popup as errors in the log file.
Here are some thoughts :
1) Edit "Saving script" on tables corresponding to the data I want to import. If we try to insert or update an object with an empty value, we do a basic check and throw an error if the mapped attribute is empty.
2) Create a vrt_attribute in sync editor based on a custom script (Create new property > Script property). Do a basic check and throw an error if the mapped attribute is empty.
3) Create a dedicated workflow that inserts an object in the table DPRJournalFailure with the information about the empty value.
#3 requires heavy customizations. #1 works just fine, but it would be better if all customizations were in the synchronization project.
I failed using #2 so far because calling "Throw New Exception" in a script within the sync editor results in a fatal error, meaning I can't even launch simulate or execute the project without having a popup error with the error I generated in the script. Ideally, I would like the error to be generated and added to the log file without breaking the synchronization project, just skipping one line during data import.
Is there a way to set the level of severity when throwing an error in a script property of a synchonization project so the synchronization project still can run and the error is visible in the log file?
As I have pointed out before, the only feasible way I see is to create your own process chain to trigger the CSV sync. In that process, you trigger the sync as normal but your scope needs to exclude the empty lines. The sync step generates an out-parameter with the UID_DPRJournal of the sync journal that can be used in the next process step. This process step executes a script that parses the CSV files and logs every "empty" line to the sync journal. I would log those skipped lines into DPRJournalMessage.
Got it, makes perfect sense. I'll give it a try.
Thanks a lot!