我似乎無法弄清楚如何能夠做到以下幾點:郵件在一個郵件從入站文件連接多個文件
1)騾子需要從目錄拿起文件,並把它放在一個ftp (這部分正在工作)
2)接下來,它需要郵寄上傳到單個郵件中的文件,郵件正文中提到了上傳文件的文件名。
=>這第二部分我不明白如何使用騾塊來做到這一點。我嘗試使用不同的屬性範圍將我的文件名保存在列表中,但每次到達聚合塊時,我的所有屬性都消失了(包括會話屬性)。這些文件雖然彙總,但我也需要文件名。
我在這裏錯過了一些明顯的東西嗎?謝謝!
這裏是我的xml:
<flow name="KCM-FTP" doc:name="KCM-FTP">
<file:inbound-endpoint responseTimeout="10000" doc:name="File" path="${path.kcm.uploadfolder}"></file:inbound-endpoint>
<message-properties-transformer doc:name="Message Properties">
<add-message-property key="MULE_CORRELATION_ID" value="1"/>
<add-message-property key="MULE_CORRELATION_GROUP_SIZE" value="100"/>
</message-properties-transformer>
<ftp:outbound-endpoint host="${ftp.host}" port="${ftp.port}" path="${path.ftp.inputfolder}" user="${ftp.username}" password="${ftp.password}" responseTimeout="10000" doc:name="FTP"></ftp:outbound-endpoint>
<collection-aggregator timeout="15000" failOnTimeout="false" doc:name="Collection Aggregator"></collection-aggregator>
<message-properties-transformer doc:name="Message Properties">
<add-message-property key="EmailHeader" value="#['KCM uploader \n Run: ' +server.dateTime + '\n\nFiles uploaded:\n']"></add-message-property>
</message-properties-transformer>
<foreach doc:name="For Each">
<set-attachment attachmentName="test" value="#[payload]" contentType="text/plain" doc:name="Attachment"/>
</foreach>
<smtp:outbound-endpoint host="${smtp.host}" port="${smtp.port}" to="${mail.to}" subject="${mail.subject}" responseTimeout="10000" doc:name="SMTP" from="${mail.from}"></smtp:outbound-endpoint>
</flow>