Webmasters, gagnez de l'argent en affichant des bannières contextuelles Oxado
SourceForge.net Logo
Support This Project
   LeCouteauSuisse Project
Welcome ! [ Home ]  ·  [ Downloads ]  ·  [ Forums ]  ·  [ News ]  ·  [ Documentations ]  
[ Home ]

[ Documentations ]

Check for orders


The purchasing department will give a file with all orders they want do. These file is construct with an XML format and can contains several purchase.
Here is a sample of this file :

<?xml version="1.0" encoding="utf-8" ?>
<orders>	
	<order>
		<reference>C2132</reference>
		<name>Brasil Coffee</name>
		<quantity>4</quantity>
		<price>1.2</price>
	</order>
	<order>
		<reference>C5532</reference>
		<name>Milk</name>
		<quantity>5</quantity>
		<price>0.5</price>
	</order>
	<order>
		<reference>M9887</reference>
		<name>Green Tea</name>
		<quantity>10</quantity>
		<price>1.5</price>
	</order>
</orders>
In this file we have 3 orders and we will send a mail for each order. To do this we will send an event for each order and we use the FileToEvent generator. This generator will check for new file with an XML extension in a directory (C:\CoffeeSupplyChain). When a new file is detected, the generator will split it for each <order>...</order> pair of tag and send an event with the XML contents of these tags.
Follow these steps :
  1. Open the file LeCouteauSuisse.exe.config and add this generator :
    <service name="CoffeeSupplyChain">
    	<generators>
    		<generator name="OrdersGenerator" type="LeCouteauSuisse.Components.FileToEventGenerator, LeCouteauSuisseComponents, 
    		Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0">
    			<settings>
    				<setting key="type" value="LeCouteauSuisse.Components.XMLFileToEventSplitter, LeCouteauSuisseComponents, 
    				Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0"/>
    				<setting key="path" value="C:\CoffeeSupplyChain"/>
    				<setting key="fileFilter" value="*.xml"/>
    				<setting key="includeSubdirectories" value="false"/>
    				<setting key="internalBufferSize" value="8192"/>
    				<setting key="xpath" value="//orders/order"/>
    				<setting key="data" value="my supplier address"/>
    			</settings>
    		</generator>
    		...
    	</generators>
    	<groups>
    	...
    	</groups>
    </service>
    
  2. Replace "my supplier address" with the email address of the supplier.


LeCouteauSuisse