Error handling in Mule Salesforce Batch

前端 未结 1 477
星月不相逢
星月不相逢 2021-01-26 13:50

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

相关标签:
1条回答
  • 2021-01-26 14:35

    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>
    
    0 讨论(0)
提交回复
热议问题