Chapter 9. Integration into business processes 271
For the Reply node, also specify the operation and create a process variable, for
example ProcessOutput.
You now outline the trader system process by adding activities and control
structures.
1. From the palette to the right of the BPEL editor select an Empty activity.
2. Drop that activity within the TraderSystemProcess flow and rename the
activity (for example, Validate Request).
3. Enter a second empty activity, and name it Audit Request.
4. Add a Switch statement.
Figure 9-17 depicts the process outline.
Figure 9-17 Trader process outline with activities
272 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
You now have to wire the activities together to define the execution path in the
BPEL process.
1. Right-click the Receive node and select Set Link between Flow activities.
Alternatively, you can highlight the activity node and click the Arrow icon that
appears in the top-right of the node.
2. Connect the Receive activity to the Validate Request activity, the Validate
Request activity to the Switch node, the Switch Node to the Audit Request
activity, and finally the Audit Request activity to the Reply node.
3. Delete the connection between the Receive and Reply node.
To complete the process outline, you also add case branches to the Switch node.
1. Highlight the Switch node and select the Add Cases icon that appears in the
top-right of the node.
2. Specify the name in the Description tab of the BPEL editor (for example,
Local EIS - J2C).
3. Add two branches and name them Local EIS - EJB and Remote EIS - JMS,
respectively.
4. Press Ctrl+S to save the process.
Figure 9-18 on page 273 shows the resulting BPEL process.
Chapter 9. Integration into business processes 273
Figure 9-18 Trader process outline with connected activities
Finally, you specify the conditions for the branches. Decide which branch to
execute based on context information that you receive from the external client.
1. Select the case and go to the Condition tab in the Attributes view of the BPEL
editor.
2. From the drop-down menu, choose Visual Expression. Figure 9-19 on
page 274 shows the resulting Condition tab.
274 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
Figure 9-19 Expression builder for switch conditions
3. Click Condition... in the section on the left and click the context attribute of
ProcessInput in the section on the right.
4. Click Method or Field to refine the selection and click the
equalsIgnoreCase() method.
5. Select the anotherString variable to specify the string value.
6. Click String in the section on the right and enter the value (for example,
local). Figure 9-20 shows the resulting Condition tab.
Figure 9-20 Expression builder for switch conditions showing a completed expression
7. Specify the conditions for the other two branches by using the context
attribute of the ProcessInput variable and enter, for example, tlocal and trader
for the string value. Do not forget to press Ctrl+S to save the BPEL process.
Creating EIS service bindings
Only services that are described by WSDL interfaces can be invoked from a
BPEL process. WSDL interface definitions can either be imported or they can be
created with the WebSphere Studio Application Developer Integration Edition
tools. In 6.4.3, “Enabling the EIS component using JMS” on page 156, for
example, we describe how to create a service binding for the Trader EIS
component. In 6.4.2, “Creating the EIS component” on page 141, we describe
how to generate the service bindings for the Trader IMS transaction.
Chapter 9. Integration into business processes 275
Using the tools, you can create service bindings from Java classes, Enterprise
JavaBeans, and EIS functions that can be accessed using a J2C connector. You
open the Service Creation wizard by selecting File
New Service built
from. For more details on the Service Creation wizard, refer to the WebSphere
Studio Application Developer Integration Edition help.
For the trader system process, we imported service interface descriptions for the
three services that we call from the system process:
???? The Trader J2C IMS transaction
???? The Trader integration bean of the EIS component
???? The sender bean that sends requests to the JMS-enabled Trader EIS
component
Invoking the J2C IMS service
To use an external service in a BPEL process, you create a partner link that
describes the service provider and its service. You detail the partner link by
specifying the WSDL service interface description.
The BPEL process editor creates a partner link and configures it as soon as you
drop a WSDL service description on the panel. For example, we imported the
Trader IMS service description into the service project. Select
TraderEISIMSService.wsdl and drop it on BPEL editor showing the trader
system process. From the pop-up that appears you may select the port type you
want to import. In our example, we have defined only one port type per WSDL
service description, so you can accept the default. As a result, a new partner link
is created, in our example its name is TraderEIS.
To invoke the service in the process flow, you have to add an Invoke activity and
then you select partner link, port type, and operation for the activity. To add the
Invoke activity, select the Invoke template from the palette of the BPEL editor,
and drop it on the process. In our example, we invoke different services in the
different branches of the Switch node. So, first drop an Invoke activity on the
Local EIS - J2C case of the Switch node and rename it, for example enter
InvokeIMSService.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset