I am trying to load a set of Accounts into Salesforce from a CSV file. I have configured the usual Datamapper, Upsert SFDC Step with Batch Commit and a Batch Step that handles o
In <batch:step name="Handle Failure" accept-policy="ONLY_FAILURES"/>
you can use #[getStepException()]
MEL to get the exception Map.Later than you can use choice component based on the exception you wants to handle the logic. Refer:http://blogs.mulesoft.com/dev/mule-dev/handle-errors-batch-job/
Make sure using <batch:job name="BatchFlow" max-failed-records="-1">
, max failed record set to -1
, so that flow wont be stopped and if failure happens in any record it will pass it to 'only failure' flow.
<batch:job name="BatchFlow" max-failed-records="-1">
<batch:process-records>
<batch:step name="Batch_Step">
<!-- Success flow... -->
</batch:step>
<batch:step name="Handle Failure" accept-policy="ONLY_FAILURES">
<logger message="Details:#[getStepException()]" level="INFO" doc:name="Logger"/>
<!-- other logic -->
</batch:step>
</batch:process-records>
</batch:job>