Is there a way to force an error in the Datamapper for the purpose of managing the error in Workflow.
For instance, I would like the datamapper to throw an error when a specific condition is met either in an Action step or in the Condition step. This should then in turn force the Execute Datamapping plugin in Workflow to error and I can then use the On Error tab to alert the control team.
The whole file should not process if a single record is invalid or does not meet specific conditions. I found a way to stop processing the current record, but I need it to stop the whole datamapping operation and throw an error that can be exploited in Workflow
I tried using the standard the javascript try\catch\throw but this doesn’t force the datamapping step in Workflow to error.
You could set the Output type of the Execute Data mapping step to either Output records to Metadata or Output results in XML data file and setup a conditional script that would look for the presence or absence of what you are looking for.
Then in Workflow, run the DataMapper task but tick the “Validate only” option. This will go through the entire file without extracting anything and will store in the metadata all the documents in which the error was encountered. In each metadata Document node, you will have the error message and the index of the record in which it occured.
If there are no errors, then you can run the DataMapper for real, if not, then you can do whatever error processing you need based on the information in the metadata.