The first step to defining a flow processor is to understand the dialog that is needed by the business process. A use case analysis can be used to create a state diagram, which in turn may be used as a guide to defining the flow processor. This example uses the following use case:
Credit Card Application use case
1 The user selects an option from the main menu to obtain a credit card.
2 The system attempts to obtain the financial parametric data from the customer credit history.
3 If the system cannot find enough information, the "Request Financial Information" dialog is executed.
4 When the financial information is obtained, the system selects all the credit cards for which the customer is qualified.
5 The system presents a page with the list of credit cards that allows the user to select one of them. A "cancel" action is available to end the operation. The user selects a credit card.
6 The system presents a confirmation page, which includes a summary of the operation that the user wants to perform and information about the credit card selected by the customer. A "cancel" action is available to cancel the operation, and a "back" action is available to return to the page that presents the list of credit cards. An "OK" action is available to accept the terms and conditions. The user presses the "OK" action.
7 The system presents a page informing the user that the operation has been executed successfully. The user presses the "OK" action.
8 The system presents the home page, which presents the main operations menu.
Subcase: Request Financial Information
9 The system presents a page with entry fields that requests all the financial information required for a credit card application. An "OK" action is available to submit the request, and a "cancel" action is available to end the operation. The user selects one of these buttons.
10 The system validates the data and stores it in the database.
State diagram
Each of the processes described in the use case has its own initial state and ends with a final state. The following diagram illustrates both processes and how they are related:
The "Gather Info" subflow process exits have returning arrows with the eventNames underlined. This is to differentiate them from regular events between states of the same flow. States with a type of "final" have an exitEventName in the typeIdInfo attribute. They are used as the eventNames to be passed to the parent process.
HTML flow processor definition
The HTML Channel flow processor is configured in the toolkit configuration file (DSE.INI) as follows:
The main-flow flow processor for this example is defined as the HTML Channel processor. The "Gather Info" state from the state diagram is defined as a subflow state, and is linked to the subflow definition by the "financialInfoState" id value. This flow processor is defined in the flow processor definition file (DSEPROC.XML) as follows:
The sub-flow flow processor for this example is defined as the HTML Channel processor and defined in the flow processor definition file (DSEPROC.XML) as follows: