Created
February 7, 2012 20:13
-
-
Save svacas/1761679 to your computer and use it in GitHub Desktop.
foreach & xpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="process-order"> | |
<http:inbound-endpoint address="http://localhost:8088/process-order"/> | |
<object-to-string-transformer/> | |
<foreach expression="#[xpath:/PurchaseOrder/Items/Item]"> | |
<choice> | |
<when expression="#[xpath:/Item/GiftWrap/text()='true']"> | |
<jms:outbound-endpoint queue="giftwrap.queue" exchange-pattern="one-way"/> | |
</when> | |
<otherwise> | |
<jms:outbound-endpoint queue="regularwrap.queue" exchange-pattern="one-way"/> | |
</otherwise> | |
</choice> | |
</foreach> | |
<message-properties-transformer scope="invocation"> | |
<add-message-property key="email_to" value="#[xpath://Email]"/> | |
</message-properties-transformer> | |
<smtp:outbound-endpoint host="localhost" from="store@mail.com" to="#[variable:email_to]" subject="Your order details"> | |
<expression-transformer expression="#[string:Dear #[xpath://Name], your order total is #[xpath:sum(//Price)].]" /> | |
<email:string-to-email-transformer/> | |
</smtp:outbound-endpoint> | |
</flow> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment