Dropping a message within an iterate or a for-each mediator -WSO2 EI

<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="ReconIteratorSeq" onError="ReconJsonErrorSeq">

<foreach xmlns:ns="http://org.apache.synapse/xsd" id="Loop" expression="//transactions">
<sequence>
...
...
</sequence>
</foreach>
<filter xmlns:ns="http://org.apache.synapse/xsd" source="get-property('ErrorComparator')" regex="true">
<then>
<log>
<property name="Validation Failure" value="True"/>
</log>
<drop/>
</then>
<else>
<log>
<property name="Validation Failure" value="False"/>
</log>
</else>
</filter>
</sequence>
<property name="ErrorComparator" value="true" scope="default" type="BOOLEAN"/>

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade