How to: |
In this iWay Enable application, a channel consisting of a File listener as the inlet, a route associated with the process flow created using iWay Designer, and a default outlet will be created using the iWay Service Manager Administration Console. The channel will pick up batched sales transactions from an incoming directory and process them to generate and gather business data.
To configure a File listener using the iWay Service Manager Administration Console:
The Listeners pane opens, as shown in the following image.
The table that is provided lists existing listeners and a short description for each.
The Listener Type pane opens.
The configuration parameters pane for the File listener opens.
Parameter |
Value |
---|---|
Input Path |
C:\Sales_Demo\sales_data\in |
Destination |
C:\Sales_Demo\sales_data\out |
Suffix In |
xml |
The Name and Description pane opens.
The new File listener (sales.listener) is added to the list in the Listeners pane.
You are now ready to define an inlet and associate it with the new File listener (sales.listener).
To define an inlet for your channel:
The Inlets pane opens, as shown in the following image.
The table that is provided lists each inlet that is defined with a brief description.
The New Inlet Definition pane opens.
The Construct Inlet pane opens.
The table that is provided is used to list the components that are currently registered with the inlet.
The Select component type pane opens.
The Select a listener definition pane opens, as shown in the following image.
You are returned to the Construct Inlet pane, which now includes the File listener (sales.listener) you registered with your inlet (sales.inlet).
If you return to the main Inlets pane, you will notice that the new inlet you just defined (sales.inlet) has been added to the list, as shown in the following image.
You are now ready to define a route and associate it with the process flow (sales.process) that you created earlier and published to the iWay Registry using iWay Designer.
To define a route for your channel:
The Routes pane opens, as shown in the following image.
The table that is provided lists each route that is defined with a brief description.
The New Route Definition pane opens.
The Construct Route pane opens.
The table that is provided is used to list the components that are currently registered with the route.
The Select component type pane opens.
The Select a process definition pane opens, as shown in the following image.
You are returned to the Construct Route pane, which now includes the process flow (sales.process) you registered with your route (sales.route).
If you return to the main Routes pane, you will notice that the new route you just defined (sales.route) has been added to the list, as shown in the following image.
You are now ready to construct your channel using the iWay components (inlet and route) that you have defined.
After you have defined the inlet (sales.inlet) and route (sales.route) that will be used by the iWay Enable application, you can combine these components and construct a channel using the iWay Service Manager Administration Console. Every channel is required to have an inlet, a route, and an outlet. In this example, a predefined default outlet will be used and associated with the new channel.
The Channels pane opens, as shown in the following image.
The table that is provided lists each channel that is defined with a brief description.
The New Channel Definition pane opens.
The Construct Channel pane opens.
The table that is provided is used to list the components that are currently registered with the channel.
The Select component type pane opens.
The select an inlet definition pane opens.
You are returned to the Construct Channel pane, which now includes the inlet (sales.inlet) you defined earlier.
You are now ready to add a route to the channel.
The Select component type pane opens.
Notice that only the Route and Outlet component types are listed, since you have already added an inlet to the channel.
The select one or more route definitions pane opens.
You are returned to the Construct Channel pane, which now includes the inlet (sales.inlet) and route (sales.route) you defined earlier.
You are now ready to add an outlet to the channel.
The Select component type pane opens.
The select one or more outlet definitions pane opens.
You are returned to the Construct Channel pane, which now includes the inlet (sales.inlet), route (sales.route), and outlet (default.outlet).
If you return to the main channels pane, you will notice that the channel you just constructed (sales.channel) has been added to the list, as shown in the following image.
After you have designed your channel, you are ready to build and deploy the channel into a run-time environment.
To build and deploy your channel:
The Channels pane opens, as shown in the following image.
The build result pane for sales.channel opens.
The Deployments pane opens, showing links to Channels, Services, Metrics, and Web Services, in the left pane. By default, Channels is selected and the Channel Management pane is displayed, as shown in the following image.
The Available Channels pane opens.
You are returned to the Channel Management pane. Notice that sales.channel is now included in the list of deployed channels.
Note: Once a channel is deployed, you must also start it. A deployed channel is not started automatically. Notice the red X in the Status column for sales.channel.
A green checkmark now displays in the Status column, indicating that sales.channel is started.
You can now test your new channel (sales.channel) to ensure that it is running properly.
To test your channel:
<SALES> <TRANSACTION> <ProductID>1</ProductID> <Region>US</Region> <Quantity>5</Quantity> <SalePrice>50</SalePrice> </TRANSACTION> <TRANSACTION> <ProductID>2</ProductID> <Region>EU</Region> <Quantity>5</Quantity> <SalePrice>100</SalePrice> </TRANSACTION> <TRANSACTION> <ProductID>3</ProductID> <Region>US</Region> <Quantity>5</Quantity> <SalePrice>150</SalePrice> </TRANSACTION> <TRANSACTION> <ProductID>1</ProductID> <Region>EU</Region> <Quantity>5</Quantity> <SalePrice>175</SalePrice> </TRANSACTION> <TRANSACTION> <ProductID>2</ProductID> <Region>US</Region> <Quantity>5</Quantity> <SalePrice>200</SalePrice> </TRANSACTION> </SALES>
C:\Sales_Demo\sales_data\in
This is the same input directory that was configured earlier for the File listener (sales.listener), which is used to pick up batched sales transactions.
C:\Sales_Demo\sales_data\out
Notice that the SalesTransactions.xml response document is now available, as shown in the following image.
The following example shows the contents of the SalesTransactions.xml response document that is returned.
<?xml version="1.0" encoding="ISO-8859-1" ?> <emitstatus status="0"> <parms> <parm name="return">status</parm> <parm name="crosssection">false</parm> <parm name="skipNodes">1</parm> <parm name="xpathExpr">XPATH(/SALES/TRANSACTION)</parm> </parms> <timestamp>2009-05-06T21:18:09.794Z</timestamp> <status>0</status> <iterator>5</iterator> <msg>success</msg> </emitstatus>
Notice that the <msg> element tag indicates success and the <iterator> element tag has a value of 5. This value indicates that five iterations were performed. The process flow you configured earlier in iWay Designer (sales.process) uses an Iterator object (Loop Transactions) and a File object (Tap Data and Write to File) to split incoming batched sales transactions and write the individual sales transactions to a target directory.
C:\Sales_Demo\data\out
Notice that five XML documents are now available in the target directory, as shown in the following image.
Each XML document represents a single sales transaction that was split from the SalesTransactions.xml input document, which contains the batched data.
For example, sale_0001.xml has the following contents:
<?xml version="1.0" encoding="ISO-8859-1" ?> <TRANSACTION> <ProductID>1</ProductID> <Region>US</Region> <Quantity>5</Quantity> <SalePrice>50</SalePrice> </TRANSACTION>
For example, sale_0002.xml has the following contents:
<?xml version="1.0" encoding="ISO-8859-1" ?> <TRANSACTION> <ProductID>2</ProductID> <Region>EU</Region> <Quantity>5</Quantity> <SalePrice>100</SalePrice> </TRANSACTION>
If you have received the same results that are described in this section, your new channel (sales.channel) has been tested successfully and is fully operational.
iWay Software |