simplified XML with inner beans
This commit is contained in:
@@ -25,29 +25,27 @@
|
||||
<entry key="productNs" value="http://www.example.org/prodcuts" />
|
||||
</util:map>
|
||||
|
||||
<!--
|
||||
split the inbound order into a number of orderItem documents that can
|
||||
be processed separately
|
||||
-->
|
||||
<!-- split the inbound order into a number of orderItem documents that can be processed separately -->
|
||||
<si-xml:xpath-splitter id="orderItemSplitter" input-channel="ordersChannel" output-channel="stockCheckerChannel" create-documents="true">
|
||||
<si-xml:xpath-expression expression="/orderNs:order/orderNs:orderItem" namespace-map="orderNamespaceMap" />
|
||||
</si-xml:xpath-splitter>
|
||||
|
||||
<!-- if each order -->
|
||||
<si:service-activator input-channel="stockCheckerChannel" output-channel="orderRoutingChannel" ref="stockChecker" />
|
||||
<!-- if each order -->
|
||||
<si:service-activator input-channel="stockCheckerChannel" output-channel="orderRoutingChannel">
|
||||
<bean class="org.springframework.integration.samples.xml.StockChecker">
|
||||
<constructor-arg ref="selectIsbnXpath" />
|
||||
</bean>
|
||||
</si:service-activator>
|
||||
|
||||
<si-xml:xpath-expression id="selectIsbnXpath" namespace-map="orderNamespaceMap" expression="/orderNs:orderItem/orderNs:isbn/text()" />
|
||||
<bean id="stockChecker" class="org.springframework.integration.samples.xml.StockChecker">
|
||||
<constructor-arg ref="selectIsbnXpath" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- if in stock route to the warehouse else route to the out of stock channel -->
|
||||
<si-xml:xpath-router id="instockRouter" channel-resolver="mapChannelResolver"
|
||||
input-channel="orderRoutingChannel" resolution-required="true">
|
||||
<si-xml:xpath-expression expression="/orderNs:orderItem/@in-stock" namespace-map="orderNamespaceMap" />
|
||||
</si-xml:xpath-router>
|
||||
|
||||
<bean id="mapChannelResolver"
|
||||
class="org.springframework.integration.channel.MapBasedChannelResolver">
|
||||
<bean id="mapChannelResolver" class="org.springframework.integration.channel.MapBasedChannelResolver">
|
||||
<property name="channelMap">
|
||||
<map>
|
||||
<entry key="true" value-ref="warehouseDispatchChannel" />
|
||||
@@ -57,16 +55,17 @@
|
||||
</bean>
|
||||
|
||||
<!-- dispatch order if in stock -->
|
||||
<si:outbound-channel-adapter ref="warehouseDispatch" method="dispatch" channel="warehouseDispatchChannel" />
|
||||
<bean id="warehouseDispatch" class="org.springframework.integration.samples.xml.WarehouseDispatch" />
|
||||
|
||||
<si:outbound-channel-adapter method="dispatch" channel="warehouseDispatchChannel">
|
||||
<bean class="org.springframework.integration.samples.xml.WarehouseDispatch" />
|
||||
</si:outbound-channel-adapter>
|
||||
|
||||
<!-- convert the order item to a format that can be understood by BigBooks the wholesaler -->
|
||||
<si-xml:xslt-transformer input-channel="outOfStockChannel" output-channel="resupplyOrderChannel"
|
||||
xsl-resource="classpath:org/springframework/integration/samples/xml/bigBooksSupplierTransformer.xsl"/>
|
||||
|
||||
<!-- send the resupply order -->
|
||||
<si:outbound-channel-adapter ref="externalResupply" method="orderResupply" channel="resupplyOrderChannel" />
|
||||
<bean id="externalResupply" class="org.springframework.integration.samples.xml.ExternalResupply" />
|
||||
<si:outbound-channel-adapter method="orderResupply" channel="resupplyOrderChannel">
|
||||
<bean class="org.springframework.integration.samples.xml.ExternalResupply" />
|
||||
</si:outbound-channel-adapter>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user