How to: |
A key part of any business process is the ability to modify or enable data capture at any point in time. A process flow can contain independent taps that are not configured initially with a specific expression. This allows you to modify or activate any tap using the iWay Service Manager Administration Console without having to go back to iWay Integration Tools the original process flow. As a result, you can have multiple deactivated taps in a process flow that serve as placeholders for future use. If the data capture requirement changes or there is a need to monitor more data, these taps can be activated accordingly.
To update taps:
The iWay Service Manager Tools pane opens.
The Views pane opens, as shown in the following image.
Note: The sales.process.tap2 tap was created earlier, but not configured.
The Edit IFL Expression dialog box opens.
_erules("QuantityPerCategory",xpath("/TRANSACTION/ProductCat"))
This expression calls a Rule set called “QuantityPerCategory” and this Rule set takes the product category as an input and creates business events which capture the quantity sold in each transaction based on the category of the product in that transaction.
You are returned to the Views pane, where the new expression is now added to the Expression column for the sales.process.tap2 tap.
Note: You may need to refresh your Web browser after the expression is saved.
There are three types of business events. Each corresponds to the above categories as they occur in each transaction. These business events capture the quantity of the product which is being sold based on their category. The three events are:
In addition to capturing business events for reporting the quantity sold, it might be interesting to discover what type of product was sold in each transaction and to use Enable Event Modeling tools to find out which product had the highest number of sales.
The Rules pane opens, as shown in the following image.
The following table shows the Rule configuration.
Rule |
Action |
---|---|
isCategoryElectronics |
script.exposect('sales.quantity.electronics',cid,script.xpath('//Quantity')); |
isCategoryHardware |
script.exposect('sales.quantity.hardware,cid,script.xpath('//Quantity')); |
isCategoryGarden |
script.exposect('sales.quantity.garden,cid,script.xpath('//Quantity')); |
You are now able to tap into additional data through the process flow (sales.process) that was configured earlier and generate business events. As the process flow processes the batched sales transactions, it triggers the sales.process.tap2 tap, which runs the corresponding Rule set. As a result, the three business events "sales.quantity.electronics", "sales.quantity.hardware" ,and "sales.quantity.garden" get generated each time the transaction matches one of the product categories.
C:\Sales_Demo\sales_data\in
The iWay Service Manager Tools pane opens.
The Views pane opens, as shown in the following image.
You should have three business events generated and by moving the mouse on each one, you can see the number of the occurrences of each event while the SalesTransactions.xml file is being processed. This information can be useful if you want to know which category of products is being sold the most in real time.
Next, make a visual comparison between the quantities of the sold products based on their categories. To do this, you can use the Infoset feature of Enable 1.2. The Infoset can be used to aggregate and format real time data into feeds, which can be consumed by charts and graphs.
The result below lists the business events.
Note: When the events are being generated, the value of the quantity field in every transaction is assigned to the value column in the event table.
You can now create a feed to contain all the information you need for all three business events. This feed will be consumed by a Real Time Column chart in the later section to give us the visual representation of the quantity comparison in real time.
Double-click the Usage column to see the expression that was created by saving the feed. The feed has all the values you need for the three business events that were created earlier.
The iWay Service Manager Tools pane opens.
The Resources pane opens and displays the Gauges tab by default, as shown in the following image.
The Charts tab opens and displays the available charts that can be configured, as shown in the following image.
The Real Time Column Chart configuration pane opens, as shown in the following image. A visual representation of the selected chart (for example, Real Time Column) is displayed on the left. There are five configuration tabs (Sources, Data, Labels, Visuals, and Extras) located on the right. By default, the Sources tab is selected.
The Data tab is used to specify what events will be used to feed the data. Since you will be using the feed created earlier directly, click the Specified radio button.
Parameter |
Value |
---|---|
Title |
Product Sales |
Subtitle |
Comparative Sales |
X Axis Name |
Time Line |
Y Axis Name |
Quantity |
Notice that as you type values in the various label fields, the chart on the left updates to reflect the new data you entered.
The Save as Portlet dialog box opens.
You are returned to the main Resources pane where the Portlets tab is now selected.
The new Real Time Column chart (ProductSaleByQty) is now added to the table.
The ProductSaleByQty window opens and displays the Real Time Column chart you configured, showing the Quantity of the categories sold in the Y Axis. On the X Axis, you can see the count, sum, avg, min, max and the last number of the product that was sold as the latest sales batched file was processed.
The Real Time Column chart contains multiple vertical columns, which represent the earlier runs of data (total product sales). This data will be updated using the two second interval that was configured. You can also click the name of the chart in the title bar to view the chart in full-screen mode.
C:\Sales_Demo\sales_data\in
The Real Time Column chart will update in a few seconds to reflect new data.
You will need to find the type of product (Product Name) being sold in each transaction. To do this you must modify the Action section of each Rule under the "QuantityPerCategory" Rule set and create business events to report the name of the product for each category.
script.exposect('eventPrefix.'+script.xpath('//ProductName'),cid);
The above function creates a business event with the following name convention:
eventPrefix.ProductName
The following table shows the Rule configuration.
Rule |
Action |
---|---|
isCategoryElectronics |
script.exposect('sales.electronics.'+script.xpath('//ProductName'),cid); |
isCategoryHardware |
script.exposect('sales.hardware.'+script.xpath('//ProductName'),cid); |
isCategoryGarden |
script.exposect('sales.garden.'+script.xpath('//ProductName'),cid); |
Now you can process another batched sales transaction to see the result. You will be able to see the new business events that are generated to report and the name of the product that is being sold for each transaction. You can then use the Event Cloud to see which product has the highest sales.
The Views pane shows all the newly created business events containing events with the prefix of the category appended to the name of the product that was sold, which is separated by a period. As you can see in the following image, the business event sales.hardware.hammer has a larger font in comparison with the other business events which were generated as a result of the processing of the latest batched transaction. This means that the hammer product has the highest sale in comparison to the rest of the products. You can also see the count of the sold product by moving your mouse on the name of the event.
iWay Software |