The Sale example application
The Sale example application is a sample BTS application that you can set up to see the workings of a business transaction. The business transaction has four basic actions; order entry, delivery, invoice, and payment. It also includes some more advanced BTS features.
About the Sale example application
- The Order activity obtains order data from the user, and validates it.
- Successful completion of the Order activity causes the Delivery activity to be started.
- Completion of the Delivery activity causes the Invoice activity to be started.
- When payment is received and recorded by the Payment activity, the Sale business transaction is complete.
Figure 1 shows, in simplified form, data flows in the Sale example application.
- Customer data (for example, an account number) collected after the terminal user selects the Sale menu option is used as input to the Order activity.
- Customer data collected by the Order activity is used as input to the Delivery activity.
- The output data produced by the Delivery activity is used as input to the Invoice activity.
- The output produced by the Invoice activity is used as input to the Payment activity.
The first activity (Order) requires input from the terminal user. Subsequent activities (Delivery, Invoice and Payment) are assumed not to require any user involvement and are triggered serially in the background after the Order activity has completed successfully. This assumption can be changed to illustrate additional function.
The Sale example application: CICS transactions, programs, and copybooks
The Sale application uses category 3 sample transactions and sample programs. The copybooks, maps, and map sets are also supplied with CICS, and the source modules are fully annotated with explanatory comments.
The sample is implemented as a set of COBOL programs. These programs are supplied, in source code, in the SDFHSAMP library, together with copybooks and BMS maps and map sets. The resource definitions are in an RDO group DFH$CBTS.
Table 1 shows the CICS® transactions and programs that make up the application.
Transaction | Program | Function |
---|---|---|
SALM | DFH0SAL0 | Order entry. The order entry transaction is a regular CICS transaction running outside the BTS environment. |
SAL1 | DFH0SAL1 | Accepts the order and defines and runs the SALE process. |
SALE | DFH0SAL2 | The root activity of the SALE process.
This is the main logic-control program. It defines and runs the following
activities:
|
RED1 | DFH0RED1 | Implements the customer credit-check activity. |
STOC | DFH0STOC | Implements the stock-level check activity. |
DEL1 | DFH0DEL1 | Implements the delivery note activity. |
INV1 | DFH0INV1 | Implements the invoice activity. |
REM1 | DFH0REM1 | Implements the payment-not-received reminder activity. |
PAYM | DFH0PAY0 | Payment input. The payment input transaction is a regular CICS transaction running outside the BTS environment. |
PAY1 | DFH0PAY1 | Accepts the payment information, then acquires and runs the appropriate SALE process. This causes the SALE process to complete. |
Table 2 shows the copybooks, maps, and map sets that are supplied with the sample application.
Type | Member | Description |
---|---|---|
Copybook | DFH0CONT | Container definitions. |
Copybook | DFH0SALC | Defines BMS map fields for the SALM transaction. |
Copybook | DFH0PAYC | Defines BMS map fields for the PAYM transaction. |
Map/Mapset | DFH0SALM | Source of the BMS map for the SALM transaction. The map set is DFH0SAS. The name of the map is ORDER. |
Map/Mapset | DFH0PAYM | Source of the BMS map for the PAYM transaction. The map set is DFH0PAS. The name of the map is PAYMENT. |
You can use the sample as the basis of your own sales application. However, before using it in a production environment, you must add installation-specific code.
EXEC CICS DEFINE ACTIVITY('CREDIT-CHECK')
TRANSID('RED1')
PROGRAM('DFH0RED1')
USERID('USER0001')
RESP(RESP-AREA)
RESP2(RESP2-AREA)
END-EXEC.
You must change the value of the USERID option to specify a user ID that is valid in your installation. You must enter the customer number and order number because they are used by the DEFINE PROCESS command. The PROCESS must have a unique name.
Running the sample application from a web browser
You can run the sample application from a web browser. The DFH0SAL0 program source code contains detailed instructions about how you can put a web front end on to the two BTS processes used in the sample.