简体   繁体   中英

WSO2 Iterate mediator does not maintain order even though sequential="true"

I have scenario like ,

  1. Reading unreaded gmail which contains attachment(ie Images)
  2. for iterating over attachment, i have used Iterate Mediator in WSO2 EI
  3. Inserting those each image attachment to Salesforce File Object.

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.

使用带有选项 blocks="true" 的调用中介来执行同步调用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM