Reputation: 987
I have scenario like ,
Process works fine. my question here is iterate mediator doesn't maintain the order in which attachment presented in email body even though setting sequential="true" .
<iterate continueParent="true" description="MailIterator" expression="//parts" id="listUnread" sequential="true">
<target>
<sequence>
<property expression="//filename/text()" name="AttachedFileName" scope="default" type="STRING"/>
<property expression="substring-after(get-property('AttachedFileName'),'.')" name="Attachmentextension" scope="default" type="STRING"/>
<filter description="check emailSubject" regex="jpg|jpeg|png|gif|webp|tiff|tif|psd|raw|bmp|dib|heif|heic|indd|ind|jp2" source="get-property('Attachmentextension')">
<then>
<property description="emailAttachmentId" expression="//attachmentId/text()" name="uri.var.attachmentId" scope="default" type="STRING"/>
<log level="custom">
<property expression="get-property('AttachedFileName')" name="=====ValidAttachmentFileName===="/>
<property expression="get-property('uri.var.attachmentId')" name="====emailAttachmentId====="/>
</log>
<!-- Salesforce file object insert process done here -->
</then>
<else>
<log level="custom">
<property expression="fn:concat('Image format. FileName is:',get-property('AttachedFileName'))" name="===Invalid"/>
</log>
</else>
</filter>
</sequence>
</target>
</iterate>
It process all attachment in some other order which is different from email body attachment order. Kindly anyone clarify this. Thanks in advance.
Upvotes: 1
Views: 504
Reputation: 5946
Use call mediator with option blocking="true" to perform synchronous calls
Upvotes: 1