Environment overview
This chapter describes the environment that is used in our example in this book.
In addition, this chapter describes the sample application that is used to send events to IBM Operational Decision Manager and the IBM Business Monitor.
This chapter includes the following topics:
 
4.1 Example environment
To provide examples and demonstrate how to use event processing, a basic environment was created, as shown in Figure 4-1.
 
Tip: If you want to follow the examples that are shown, you must have access to an environment with similar components. However, the structure is flexible.
Figure 4-1 Shopping sample application environment
The following components are shown in Figure 4-1:
1. The example environment exists on a single z/OS logical partition (LPAR).
2. A single CICSplex enables CICS Explorer to connect through a web-based user interface and provide update facilities.
3. The CICSplex requires a maintenance point IBM CICSPlex® SM address space (CMAS).
4. The CICSplex has multiple CICS-managed address spaces; that is, CICS regions in which the example application runs and events are emitted
5. A web-based GUI is required to allow the CICS Explorer to connect to the CICSplex. To allow the update functions of CICS Explorer, the CMCIPORT(1491) parameter must be defined.
6. HTTP 1.1 compliant servers are required to allow events to be emitted from the CICS regions to both IBM Business Monitor (BM) and IBM Operational Decision Manager (ODM), by using HTTP EP adapters. The environment that is described in Figure 4-1 on page 70 has IBM ODM for z/OS that is running on the same z/OS LPAR as the CICS regions. However, in your environment, you can use any platform that is supported by IBM ODM.
7. The example environment has IBM Business Monitor installed on a Microsoft Windows Server.
4.2 Shopping sample application
To provide the examples, a simple order processing application was developed. This application is not intended to represent a real-life application. Instead, it is intended to show multiple possibilities for event processing API capture points. Figure 4-2 shows the order process that the example application implements.
Figure 4-2 Shopping sample application order process
As shown Figure 4-2, the order process includes the following stages:
1. A customer displays a list of stock items on the panel.
2. A stock item is displayed that shows the stock level and price.
3. If satisfied with the selection, the stock item is ordered and the order is posted to the ORDER file.
4. The warehouse takes orders and fulfills them by reducing the stock levels.
5. The warehouse marks the order as shipped.
A set of programs, transactions, BMS maps, and copy books were developed to implement this order process. The structure of the application is shown in Figure 4-3 on page 72,
Figure 4-3 Shopping sample application structure
The following components of the Shopping sample application are shown in Figure 4-3:
1. Transaction and program MENU provides the ability to drive the various functions of the application. The BMS map (MENU1) has a field to enter a five-digit customer number, which is required for the query list and order item functions.
2. From the menu, providing a customer number and pressing PF1 starts the psuedo-conversational transaction QRY and program QUERY. This initially brings up a list of stock items from the STOCK file.
3. By using any character to select a stock item from the list, displays the stock level and price of the item.
4. From the menu, providing a customer number and pressing PF2 starts the conversational program ORDER. This allows the users to enter the stock item ID and quantity to order. Program SENDORDR is called to generate a record on the ORDER file and a confirmation panel opens.
5. From the menu, pressing PF4 simulates the warehouse fulfilling all outstanding orders by running program fulfill. A message is displayed on the menu detailing how many items are fulfilled and the total value of all the orders.
6. From the menu, pressing PF5 simulates the warehouse shipping all fulfilled orders by running program SHIP. A message is displayed on the menu detailing how many items were shipped.
The shopping sample application with all its source and setup job control language (JCL) can be downloaded from the Redbooks website. The provided readme.txt file provides details about how to upload the files to z/OS and configure and run the setup JCL.
4.3 Sample scenarios
To allow the next chapters to provide semi-realistic demonstrations, the following four scenarios were developed to be used with the example application:
Query versus sale
Stock low
Shipped order meets service level agreement (SLA)
High-value order breakdown
4.3.1 Scenario: Query versus sale
This scenario emails a discount offer to a customer if the customer queried a stock item repeatedly (four times), but did not order it. The theory behind this idea is that the customer is interested in an item but might need some encouragement to complete the sale. Figure 4-4 shows the flow of this scenario.
Figure 4-4 Query versus sale scenario
The scenario that is shown in Figure 4-4 on page 73 includes the following stages:
1. The customer queries the item for the first time.
2. The customer repeats the query.
3. The customer repeats again.
4. The customer repeats the query for the fourth time.
5. The scenario waits for a period (in the examples, this period is three minutes for demonstration purposes).
6. If an order with the same stock ID and customer number was been received in that time, an email is sent with a discount offer.
For this scenario to work, two types of events must be emitted from the example application: four of the query events, each emitted whenever a query item is performed, and one of the order events when an order is placed.
This type of scenario is best-suited for IBM ODM to process the events that are emitted from CICS TS. The HTTP EP adapter is used to send events from CICS TS to the ODM server.
4.3.2 Scenario: Stock low
This scenario sends an event whenever an order is fulfilled and the stock level is below 50 units. This event alerts the warehouse through a dashboard that the item must be restocked. Figure 4-5 shows the flow of the scenario.
Figure 4-5 Stock flow scenario
The scenario that is shown in Figure 4-5 includes the following stages:
1. The fulfill process allocates stock to each outstanding order.
2. The stock level is under 50.
3. Update a dashboard with a request to replenish the stock.
For this scenario to work, an event must be emitted whenever the stock record is updated and the level is below 50.
This type of scenario is best-suited for IBM Business Monitor to process the events emitted from CICS TS and will also use the HTTP EP Adapter.
4.3.3 Scenario: Shipped order meets service level agreements
This scenario can be used to monitor the warehouse’s efficiency. Figure 4-6 shows the flow of the scenario.
Figure 4-6 Order end to end scenario
The scenario that is shown in Figure 4-6 includes the following stages:
1. An order is placed.
2. The warehouse ships the order.
3. The times are compared and a Key Performance Indicator is updated to reflect the warehouse’s efficiency.
Events are to be emitted whenever an order is placed and shipped. The order placed event that is used in 4.3.1, “Scenario: Query versus sale” on page 73 can be reused here.
This type of scenario is best-suited for IBM Business Monitor to process the events emitted from CICS TS and use the HTTP EP Adapter by using the Common Base Event format.
4.3.4 Scenario: High-value order breakdown
This scenario allows a dashboard to present a breakdown of what high-value orders are being placed within the system. The dashboard can be configured to present an order distribution that is based on demographics, customer importance, order values, and hot stock items. Figure 4-7 shows the flow of the scenario.
Figure 4-7 High value order scenario
The scenario that is shown in Figure 4-7 includes the following stages:
1. An order is placed.
2. The dashboards are updated with the new breakdowns.
An event is emitted whenever an order is placed. Because the items of data that are required to be emitted with the event are more complex than those that are available at a standard capture point in this application, this scenario must be an intrusive change to the application code so that all the data can be collated and emitted together.
This type of scenario is best-suited for IBM Business Monitor to process the events emitted from CICS TS and will use the HTTP EP Adapter.
4.4 The events emitted from the sample application
The capture points in the examples are based on the CICS API calls made in each phase of the order process in the shopping sample application (Query stock, Order Item, fulfill Order, and Ship Order). Table 4-1 on page 77 shows the information that is contained in the capture specifications for the sample event binding. The Emitted Business Information column contains the payload data that is captured with the events, which is selected from the containers that are passed with each API command.
Table 4-1 The capture points in the sample MENU application
Event Name
Capture Point
Predicates
Emitted Business Information
QueryStock
Program Initiation
Program Name = QUERY
CustomerNumber:
Numeric Packed-Decimal
Capture Length = 3
Format Length = 6
StockId:
Numeric Packed-Decimal
Capture Length = 3
Format Length = 6
Order
LINK

Capture after command.
Program Name = SENDORDR
CustomerNumber:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
OrderNumber:
Numeric Packed-Decimal
Capture Length = 3
Format Length = 6
StockId:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
Quantity:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
fulfill
PUT CONTAINER
Program name = UPDSTOCK
Container name = OUTPUT
Stock item level is < 50
StockId:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
OldLevel:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
NewLevel:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
Ship
REWRITE
Program name = SHIP
Response Code = Ok
File name = ORDER
Order status = ‘S’
OrderNumber:
Numeric Packed-Decimal
Capture Length = 3
Format Length = 6
CustomerNumber:
Numeric Packed-Decimal
Capture Length = 3
Format Length = 6
StockId:
Numeric packed-Decimal
Capture Length = 3
Format Length = 6
Quantity:
Numeric Zoned-Decimal
Capture Length = 5
Format length = 6
The capture points are based on the API calls in the shopping sample application programs, as shown in Table 4-2.
Table 4-2 API commands in the MENU sample application, on which capture points are based
Event Name
Capture Point
MENU Sample program Name
API command
QueryStock
PROGRAM INIT
QUERY
EXEC CICS RETURN TRANSID(‘QRY’)
CHANNEL(‘LIST-STOCK’)
END-EXEC.
Order
LINK

Capture after command.
SENDORDR
EXEC CICS LINK PROGRAM(‘SENDORDR’)
CHANNEL(CHANNEL-NAME)
END-EXEC.
Fulfill
PUT CONTAINER
UPDSTOCK
EXEC CICS PUT CONTAINER(‘OUTPUT’)
FROM(UPDATE-OUT)
END-EXEC.
Ship
REWRITE
SHIP
EXEC CICS REWRITE FILE(‘ORDER’)
FROM(ORDER-REC)
END-EXEC.
In addition to the above non-invasive capture points that are shown in Table 4-2 on page 78, we included the EXEC CICS SIGNAL EVENT API call that is shown in Example 4-1 in the SENDORDR sample program to demonstrate how this technique of capturing events might be used if you can alter your source code to capture events.
Example 4-1 EXEC CICS SIGNAL EVENT API call
EXEC CICS SIGNAL EVENT(‘SendOrder’)
FROM(SIGNAL-EVENT-DATA)
FROMLENGTH(LENGTH OF SIGNAL-EVENT-DATA)
END-EXEC.
The SIGNAL EVENT details are shown in Table 4-3.
Table 4-3 SIGNAL EVENT capture point in Shopping sample application
Event Name
Capture Point
Predicate
Emitted Business Information
SendOrder
SIGNAL EVENT
Event name = SendOrder
CustomerNumber:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
OrderNumber:
Numeric Zoned-Decimal
Capture Length = 5
Format Length = 6
CustomerName:
Text Character
Capture Length = 50
Format Length = 50
City:
Text Character
Capture Length = 50
Format Length = 50
Country:
Text Character
Capture Length = 50
Format Length = 50
Premium:
Text Character
Capture Length = 1
Format Length = 1
TotalOrderValue:
Numeric Zoned-Decimal
Capture Length = 11
Format Length = 13
Precision = 2
 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset