Overview of the Sale application

The Sale example implements a Sale business transaction that is made up of four basic actions:

A Sale business transaction is started by a terminal-user selecting the Sale option from a menu of business transactions. This causes an instance of the transaction to be created and its root activity to be started. The root activity creates and runs, in sequence, four child activities that implement the four actions of the business transaction:

  1. The Order activity obtains order data from the user, and validates it.
  2. Successful completion of the Order activity causes the Delivery activity to be started.
  3. Completion of the Delivery activity causes the Invoice activity to be started.
  4. When payment is received and recorded by the Payment activity, the Sale business transaction is complete.

Data flows

Figure 11 shows, in simplified form, data flows in the Sale example application.

Figure 11. Data flow in the Sale example application. (The root activity is not shown.)
 The picture shows the data flows described in the list below. A rectangle represents the Sale business transaction. The rectangle contains four smaller rectangles, representing the Order, Delivery, Invoice, and Payment child activities. Another rectangle, outside the Sale transaction, represents the Menu transaction. Input and output data flows are represented by arrows.   The Menu transaction collects input from the user. The output from the Menu transaction becomes the input to the Order activity. The Order activity collects further input from the user. The output from the Order activity becomes the input to the Delivery activity. The output from the Delivery activity becomes the input to the Invoice activity. The output from the Invoice activity becomes the input to the Payment activity.

  1. 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.
  2. Customer data collected by the Order activity is used as input to the Delivery activity.
  3. The output data produced by the Delivery activity is used as input to the Invoice activity.
  4. The output produced by the Invoice activity is used as input to the Payment activity.
Note:
The first activity (Order) requires input from the terminal user. For the purposes of this section, 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. In later sections, this assumption is changed to illustrate additional function.

CICS transactions and programs

Table 5 shows the CICS® transactions and programs that make up the basic Sale application described in this section.

Table 5. Transactions and programs in the basic Sale application
Transid Program Comments
MENU MNU001 Menu of business transactions
-- SAL001 Creates and starts the Sale business transaction
SALE SAL002 BTS root activity, manages the child activities that comprise the Sale business transaction
SORD ORD001 Order activity
SDEL DEL001 Delivery activity
SINV INV001 Invoice activity
SPAY PAY001 Payment activity
Notes:
  1. In later sections, the Sale example application is extended to illustrate more advanced features of BTS, such as:
    • Parallel activities
    • User-related activities
    • Compensation actions.
  2. For the sake of clarity, the basic example does not include any error handling code. As explained in Checking the response from a child activity, in a real application, after a parent has requested a child activity to be run it must issue a CHECK ACTIVITY command to:
    • Check the response from the child
    • Check the completion status of the child
    • Delete the child’s completion event, if the child has completed.

    The uses of the CHECK ACTIVITY command are fully described later, in Dealing with BTS errors and response codes.

Related concepts
The initial request
The root activity
Transferring input and output data
Using the BTS API to write business applications
Related reference
Overview of BTS API commands
BTS application programming commands
[[ Contents Previous Page | Next Page Index ]]