376 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
Configuring the BTTBankEJB project
To configure the BTTBankEJB project, follow these steps:
1. In the J2EE perspective, right-click the BTTBankEJB project. Select
Properties from the context menu.
2. In the pop-up window, select Java JAR Dependencies in the left navigation
panel, and check bttjdbjsvc.jar, bttjdbtsvc.jar, and DummyJournal.jar in
the right panel. Click Apply.
3. Select Java Build Path in the left navigation panel, click the Projects tab,
and check the DummyJournal project. Click the Libraries tab. Click Add
JARs to add bttjdbjsvc.jar and bttjdbtsvc.jar from the BTTBank project.
4. Click OK.
Adding the Dummy Journal service to withdrawal Single Action EJB
To modify the withdrawal business Single Action EJB, do the following:
1. In BTTBankEJB project, open the WithdrawalServerOpBean.java file from
the ejbModule/btt/bank/business/logic folder.
2. Add more import statements, as shown in Example 8-24.
Example 8-24 More import statements required by adding journal service
import com.ibm.btt.services.jdbcjournalservice.Journal;
3. Modify the execute method as shown in bold in Example 8-25.
Example 8-25 Add journal service code into WithdrawalServerOp EJB
public Hashtable execute(BTTSystemData sysData, Hashtable reqData)
throws Exception {
Hashtable result = null;
try {
// initialize context hierarchy
initialize(sysData);
Context SAEContext = getContext();
if (SAEContext.getParent() == null) {
Context parent = Context.getContextByInstanceID(getInstanceId());
SAEContext.chainTo(parent);
}
// set request data to withdrawalServerCtx
SAEContext.setValueAt("BranchId", (String)reqData.get("BranchId"));
SAEContext.setValueAt("AccountNumber",
(String)reqData.get("AccountNumber"));
SAEContext.setValueAt("Date", (Date)reqData.get("Date"));
SAEContext.setValueAt("Amount", (Float)reqData.get("Amount"));
String hostBuff = ((FormatElement)getFormat("withdrawalCSRequestFmt"))