-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPriceListRoutes.xml
58 lines (45 loc) · 2.46 KB
/
PriceListRoutes.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:pfx="http://www.pricefx.eu/schema/pfx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.pricefx.eu/schema/pfx http://www.pricefx.eu/schema/pfx.xsd">
<pfx:filter id="fetchPriceListItemsFilter"/>
<bean id="fetchPriceListItems" class="net.pricefx.integration.command.pg.FetchPriceGridItems">
<property name="priceGridId" value="simple:body"/>
<property name="filter" ref="fetchPriceListItemsFilter"/>
</bean>
<pfx:list-to-csv id="storePriceListItems" outputUri="ftp://[email protected]?password=bH45#2L14K" mapper="priceListItemMapper" dataFormat="priceListItemFormat"/>
<util:list id="priceListItemHeader">
<value>product_id</value>
<value>product_label</value>
<!--<value>result_price</value> -->
<!--<value>modified_date</value> -->
</util:list>
<bean id="priceListItemFormat" class="org.apache.camel.model.dataformat.CsvDataFormat">
<property name="useMaps" value="true"/>
<property name="header" ref="priceListItemHeader"/>
<property name="quoteMode" value="ALL"/>
<property name="delimiter" value=";"/>
<property name="skipHeaderRecord" value="false"/>
</bean>
<routeContext id="priceListRoutes" xmlns="http://camel.apache.org/schema/spring">
<route id="PriceListApprovedRoute">
<from uri="direct:priceListApproved" />
<setBody>
<simple>${body[data][id]}</simple>
</setBody>
<convertBodyTo type="java.lang.Long" />
<convertBodyTo type="java.lang.String" />
<log message="'Approved' notification received for price list '${body}'" loggingLevel="INFO"/>
<to uri="fetchPriceListItems"/>
<log message="Fetched ${body.size()} rows" loggingLevel="INFO"/>
<!--<process ref="probeProcessor" />-->
<to uri="direct:storePriceListItems"/>
<log message="Items stored" loggingLevel="INFO"/>
</route>
</routeContext>
</beans>