In this lesson, you will generate Java™ components to provide implementation code
for the tasks created in WebSphere® Business Modeler.
This section discusses how to provide the implementation
code for the following Java components:
- CheckCustomerAccountStatus
- UpdateOrderDatabase
- CancelOrderandSendNotification
- CreditRating
Complete the following steps:
- Double-click the assembly diagram.
- Right-click in a blank area on the assembly diagram panel and
select Automatic Layout. Save your work.
- Double-click CheckCustomerAccountStatus.The CheckCustomerAccountStatusImpl.java
window opens.
- Replace the contents of the following method:
public commonj.sdo.DataObject InputCriterion(commonj.sdo.DataObject Input) {
//TODO Needs to be implemented.
return null;
}
with the following content:
public DataObject InputCriterion(DataObject input) {
System.out.println(
"Check Customer Account Status Invoked");
// create CreditRating bean
com.clipstacks.credit.CreditRating creditRating =
new com.clipstacks.credit.CreditRating();
// call CreditRating bean to update the BO
DataObject orderOut = creditRating.calculateCreditRating(input);
return orderOut;
}
- Save your work. Ignore the errors at this time because they will
be fixed after you create the Java™ components in the next steps.
- For UpdateOrderDatabase, replace the contents of the following
method:
public commonj.sdo.DataObject InputCriterion(commonj.sdo.DataObject input) {
//TODO Needs to be implemented.
return null;
}
with the following content:
public DataObject InputCriterion(DataObject input) {
System.out.println("Update Order Database invoked");
return input;
}
- For CancelOrderandSendNotification,
- Select all of the text on the CancelOrderandSendNotificationImpl.java
window and delete it.
- Open the CancelOrderandSendNotificationImpl.java file, then copy
and paste its contents into the CancelOrderandSendNotificationImpl.java
window.
- Save your work and close the window.
- Create a Java package to
implement calculation of customer credit rating by clicking and then . Click Next .
- In the Source folder field, click Browse and
select . Click OK.
- For the Java package name,
enter com.clipstacks.credit and then click Finish.
- Switch to the Physical Resources view by clicking the Physical
Resources tab (located in the same area as the Business
Integration tab).
- Expand and copy the CreditRating.java file
that you downloaded following the directions in Download and import samples. Then paste the file into the
credit folder.
- Switch back to the assembly diagram editor and save it.
- Save any unsaved items. An open window with an asterisk (*) on
the tab indicates that it is not saved. You should not have errors
now.
- Rebuild all the projects by clicking , and then click OK.