Am having an inbound database endpoint am selecting records with a condition which returns 500 rows as result set.Now i want to insert the coloumns in another DB.I used the batch process and have two batch steps selecting data and inserting data. Now if while selecting data any error occurs I have to send a mail and If while inserting if it fails I need to log it in a different place.So how can I create two different exceptions for each step am not able to use catch exception in batch process.For now am using a flow reference inside batch step and handling the exception.Please provide me a better way.AM using batch execute -> batch -> batch step -> flow reference->exception handling
<batch:job name="BOMTable_DataLoader">
<batch:process-records>
<batch:step name="SelectData">
<flow-ref name="InputDatabase" doc:name="InputDatabase"/>
</batch:step>
<batch:step name="InsertData">
<batch:commit size="1000" doc:name="Batch Commit">
<flow-ref name="InserDatabase" doc:name="UpdateDataBase"/>
</batch:commit>
</batch:step>
</batch:process-records>
<batch:on-complete>