Getting started Community Training Tutorials Documentation APIs, AI & Tools
<flow name="orderHandling">
<file:listener directory="/myDirectory">
<scheduling-strategy>
<fixed-frequency/>
</scheduling-strategy>
<file:matcher filenamePattern="*.xml"/>
</file:listener>
<ee:transform>
<ee:message>
<ee:set-payload resource="createBookOrdersTransformation.dwl"/>
</ee:message>
</ee:transform>
<foreach collection="#[payload.orders filterObject ((value, key, index) -> value.type == 'books')]">
<http:request method="POST" path="/book/inventory"/>
<http:request method="POST" path="/book/order"/>
<email:send toAddresses="#[payload.customer.email]">
<email:body >
<email:content ><![CDATA[#['Your order has been placed.']]]></email:content>
</email:body>
</email:send>
<db:insert>
<db:sql >INSERT INTO ORDERS(CUSTOMER, AMOUNT) VALUES (:id, :amount)</db:sql>
<db:input-parameters><![CDATA[#[{ id : payload.customer.id, amount: payload.order.total }]]]></db:input-parameters>
</db:insert>
</choice>
</foreach>
<error-handler >
<on-error-continue>
<jms:publish destination="failedOrders"/>
</on-error-continue>
</error-handler>
</flow>



