Running the BANKAPP Sample

This section describes the operation of the BANKAPP sample from a user's perspective. The tasks described will help you understand some of the features BANKAPP provides and how end-users interact with the application.

Make sure you have all required components installed, and have properly configured and started the application to run the BANKAPP sample. For complete instructions on how to prepare to run the BANKAPP sample, refer to the BEA TUXEDO Builder Release Notes or the ReadMe files for the C++ Expert sample application. For the location of the ReadMe files, see the What You Need to Start BANKAPP section.

The following steps take you through the process of running the non-database version of the C++ Expert BANKAPP command-line client.
 

Using the BANKAPP Client Menu

When you start the BANKAPP client the main menu is displayed, followed by a prompt where you can enter the number of the operation you want to use:

*** Builder BANKAPP Client - Menu ***

--- BACKOFFICE operations

--- 1=OPEN_ACCT, 2=CLOSE_ACCT

--- TELLER operations

--- 10=INQUIRY, 11=DEPOSIT, 12=WITHDRAWAL, 13=TRANSFER

--- EXIT=99

Enter operation #:

The BACKOFFICE operations are open and close accounts, and the TELLER operation are perform a balance inquiry, deposit, withdrawal, or transfer between accounts.

To begin an operation, type the associated number at the "Enter operation #:" prompt, and press the Enter key. The BANKAPP client leads you through an interactive process where the client requests information from you, performs the requested operation based on your input, and returns the results to the display.

When an operation is completed, the menu and the "Enter operation #:" prompt are displayed again. This cycle continues until you exit the client application.

The Example of BANKAPP Interactions section shows an example of user input and BANKAPP client output for some of the available operations.
 

Using Valid Accounts

When the non-database BANKAPP server is started, it creates the following three default accounts:

You can add additional accounts until there are a total of 50 accounts. Any additional OPEN_ACCT requests will be refused.

The BANKAPP server in the non-database BANKAPP sample has no persistent storage and keeps all of the data you enter in memory. When this version of the BANKAPP server is stopped, all data is lost. Note also that, this version has no database/resource manager and Transfer transactions that fail during the deposit phase will leave the in-memory database inaccurate. (For example, the withdrawal portion of the Transfer may succeed, but the deposit portion may fail, causing the amount withdrawn to be incorrectly accounted for.).

For more details on the BANKAPP samples (database and non-database enabled), refer to the ReadMe files for the C++ Expert sample application. For the location of the ReadMe files, see the What You Need to Start BANKAPP section.
 

Example of BANKAPP Interactions

Listing 5-1 provides an example of user input and output for:

Sample user input is shown in bold.

Listing 5-1 Interacting with the BANKAPP Command-line Client
C:\Samples\CPPExpert\nodb\Bankapp>BankappClient

*** Builder BANKAPP Client - Menu ***

--- BACKOFFICE operations

--- 1=OPEN_ACCT, 2=CLOSE_ACCT

--- TELLER operations

--- 10=INQUIRY, 11=DEPOSIT, 12=WITHDRAWAL, 13=TRANSFER

--- EXIT=99

Enter operation #:

10

--- INQUIRY operation

Enter ACCOUNT_ID(nnnnnn):

10001

Calling INQUIRY...

Output SBALANCE: $11.00

*** Builder BANKAPP Client - Menu ***

--- BACKOFFICE operations

--- 1=OPEN_ACCT, 2=CLOSE_ACCT

--- TELLER operations

--- 10=INQUIRY, 11=DEPOSIT, 12=WITHDRAWAL, 13=TRANSFER

--- EXIT=99

Enter operation #:

11

--- DEPOSIT operation

Enter ACCOUNT_ID(nnnnnn):

10001

Enter SAMOUNT(nnnnn.nn):

200

Calling DEPOSIT...

Output SBALANCE: $211.00

Output STATLIN: Success

*** Builder BANKAPP Client - Menu ***

--- BACKOFFICE operations

--- 1=OPEN_ACCT, 2=CLOSE_ACCT

--- TELLER operations

--- 10=INQUIRY, 11=DEPOSIT, 12=WITHDRAWAL, 13=TRANSFER

--- EXIT=99

Enter operation #:

10

--- INQUIRY operation

Enter ACCOUNT_ID(nnnnnn):

10001

Calling INQUIRY...

Output SBALANCE: $211.00

*** Builder BANKAPP Client - Menu ***

--- BACKOFFICE operations

--- 1=OPEN_ACCT, 2=CLOSE_ACCT

--- TELLER operations

--- 10=INQUIRY, 11=DEPOSIT, 12=WITHDRAWAL, 13=TRANSFER

--- EXIT=99

Enter operation #:

10

--- INQUIRY operation

Enter ACCOUNT_ID(nnnnnn):

200000

Calling INQUIRY...

--- INQUIRYException:

--- STATLIN=Account Number not found

*** Builder BANKAPP Client - Menu ***

--- BACKOFFICE operations

--- 1=OPEN_ACCT, 2=CLOSE_ACCT

--- TELLER operations

--- 10=INQUIRY, 11=DEPOSIT, 12=WITHDRAWAL, 13=TRANSFER

--- EXIT=99

Enter operation #:

99

C:\Samples\CPPExpert\nodb\Bankapp>


 

Exiting BANKAPP

As shown on the *** Builder BANKAPP Client - Menu ***, to exit the BANKAPP application:

  1. At the "Enter operation #:" prompt, type 99.

  2. Press the Enter key.