Chapter 8. Integration using WebSphere Business Integration Adapters 227
2. Click Implementation, and on the implementation tab, enter the code shown
in Example 8-4.
Example 8-4 Data transformation from input variable
STOCKINFORequestMessage requestMessage = getQuoteInput();
STOCKINFOElement infoElement = new STOCKINFOElement();
infoElement.setSYMBOL(“IBM”);
infoElement.setVerb(“Retrieve”);
requestMessage.setBodyPart(infoElement);
3. Right-click in the code tab, then select Source → Organize Imports to
resolve the types.
This is where you would set the values coming from the InputVariable into the
QuoteInput variable. For now, to get the test going, you can enter literals.
Creating the invoke activity for adapter call
In this step, you create the invoke activity which makes the call on the JDBC
adapter service:
1. Create an invoke activity by clicking the Invoke icon and then clicking the
StockInfo Flow canvas.
2. Enter Invoke JDBC Adapter as the Display Name. (The name will be
automatically set without the spaces.)
3. Use the transition links to set the Invoke between the Assign StockInfo and
Reply activities.
Creating the partner link for the invoke activity
Next, you create the partner link for the EJB Service that you created earlier:
1. Change to the business integration perspective.
2. Select the JDBCAdapterEJB project. Expand the project until you reach the
ejbModule and the package com.itso.wbia.jdbc.
3. Drag the STOCKINFOHubRequestEJBService.wsdl file over to the partner
link box on the BPEL canvas. Figure 8-19 on page 228 shows the selection
dialog for the Hub Request service that appears after you drop the WSDL file
on the canvas.