Running H/F 1 417
Figure 8-153 The deposit BP node with withdrawalServerCtx appears
To add more Web components, perform the following tasks:
1. Double-click the withdrawal icon in the Presentation Logic block to bring up
the Web diagram.
2. Use the icons in the palette to add two actions and a Web page to the canvas.
Rename the actions as shown in Figure 8-154 on page 418.
Rename the Web page as deposit.jsp with
/btt/bank/ui/struts/withdrawal/ module name prepended.
3. Move the result.jsp icon a little lower since you will need it to display the
result of a deposit operation.
418 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
Figure 8-154 More components added to withdrawal Web diagram
To design the application flow, perform the following tasks:
1. Create a connection from the deposit.jsp to the /deposit action.
2. Create a local forward back from the /deposit action to the deposit.jsp. Use
failure as the forward name.
3. Create a local forward to the result.jsp, and mark the forward as success.
4. Associate the /deposit action to the withdrawalForm form bean.
5. Press Ctrl+S to save the change.
Running H/F 1 419
After completing these steps, the Web diagram will look as shown in
Figure 8-155.
Figure 8-155 Connect Web components
To realize the Struts actions, perform the following tasks.
To realize the /prepareDeposit action:
1. Double-click the /prepareDeposit action in the Web diagram. As you can
see, the struts-btt-withdrawal.xml has been opened in the Struts
Configuration File Editor.
2. In the Action Mapping attributes section, select the Forward radio button and
type /deposit.jsp in the text box. Press Ctrl+S to save the change.
To realize the /deposit action, switch back to the withdrawal Web diagram:
1. Double-click the /deposit action in the Web diagram. The
struts-btt-withdrawal.xml file opens.
2. Select the Type radio button in the Action Mapping attributes page, and
populate the Type field with the value
com.ibm.btt.struts.actions.WSIFAction. Populate the Input field with the
value /deposit.jsp.
3. Select withdrawalForm for the Form Bean Name field in the Form Bean
Specification section. Select Yes for the Validate field.
420 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
4. In the Action Mapping Extensions section, populate in the Class Name field
with com.ibm.btt.struts.config.BTTWSIFActionMapping.
See Figure 8-156.
Figure 8-156 Set up action mappings for the /deposit action
Running H/F 1 421
5. Click the Local Forwards tab. Ensure that /deposit is selected.
Click Add in the Local Forwards section, name the new forward success, and
populate the Path field in the Forward Attributes section with /result.jsp.
Click Add again to add the forward failure with the /deposit.jsp in the Path
field.
6. Save and close the struts-btt-withdrawal.xml file.
To realize the deposit.jsp, perform the following tasks:
1. Double-click the deposit.jsp in the Web diagram.
2. When the New JSP file wizard opens, the wizard provides the default values,
which should be accepted. Ensure that Struts JSP is selected in the Model
field, and that Configure advanced options is checked. Click Next.
3. In the tag libraries page, choose Struts html and Branch Transformation
Toolkit’s /WEB-INF/btt-html.tld tag libraries. Click Next.
4. In the next page, click Next to accept the default, or deselect Use workbench
encoding to use UTF-8, and then click Next.
5. Click Next when the JSP File Choose Method Stubs to generate dialog box
opens.
6. In the Form Field Selection page, the withdrawalForm is selected by default.
To specify which fields to use, check the accountNumber, and amount
fields. Both accountNumber and amount will be the input fields. Click Next.
7. In the next dialog box, design the input form used in the deposit.jsp page. For
the accountNumber field, input the following parameters:
–ID: AccountNumber
Label: AccountNumber
For the amount field, input the following parameters, and click Finish:
–ID: Amount
Label: Amount
To complete the Web diagram, perform the following steps:
For /prepareDeposit action, do the following:
1. Close the withdrawal.gph Web diagram and reopen it.
2. Right-click the /prepareDeposit action. Select Draw Draw Selected From
from the context menu.
3. Select Forward /deposit.jsp check box and click OK.

Get IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.