0
votes

This has to be a common scenario yet I only came across the following link so far addressing it - I have a bunch of Data Mapper elements doing Pojo to Pojo transformation and need a way to reliably capture the exceptions - right now an exception happens but there is no indication of which mapper the exception occurred in.

http://www.mulesoft.org/documentation/display/current/DataMapper+Input+Error+Policy+for+Bad+Input+Data

Can someone please point to a link which describes how to capture these errors in the mapper Thanks

1

1 Answers

0
votes

The easiest way is probably to put each data mapper transformer in a private flow with their own local exception strategies:

<flow name="main">
   <flow-ref name="transform1" />

   <flow-ref name="transform2" />
</flow>

<flow name="transform1">
   <data-mapper:transform config-ref="grf1" />

   <catch-exception-strategy>
     <!-- do something -->
   </catch-exception-strategy>
</flow>

<flow name="transform2">
   <data-mapper:transform config-ref="grf2" />

   <catch-exception-strategy>
     <!-- do something -->
   </catch-exception-strategy>
</flow>