OL Learn

How to forcibly create an error in the datamapper

I have a folder containing multiple CSV files. Each CSV file can contain multiple records.

Now we need to check that each record inside every CSV file exists in a remote database before we start processing the individual CSV files. The check is done by unique ID field assigned to each record.

The validation stage requires that we validate the existence of every single record inside every single CSV that is contained in the input folder. Only when this has been validated should we proceed with generating the output, otherwise we should send the whole folder to error.

I have a datamapper which runs a sql query which returns True or False if the record has been found in the SQL table, but how can I force the datamapper step to error and hence stop data mapping, exit the process in Workflow and send my folder to error?

The Designer API has a global fatalerror() function that forcibly aborts content creation but I was unable to find a similar function for the Datamapper.

Can anyone help please?

You can just use a script that throws an error:

throw "Record not found";

1 Like