WBSF (WebSphere Business services Fabric) enables us to dynamically invoke business services based on service policies in SOA development. Through a concrete example, this paper describes how to dynamically invoke business services through the WBSF V6.02 SCA programming model.
Assembly Service Process
Create Accountqueryprocess Business processes:
Switch WID to the "Business integration" perspective and create a new Accountquerymodule interface in the Accountqueryproc project that contains the query method, as shown in Figure 1:
Figure 1 Creating the Accountqueryproc interface
In the Accountquerymodule project, create a new Business Process "Accountqueryprocess" for the Bpel selection interface for Accountqueryproc. The BPEL first invokes Authorizationservice and then calls Accountqueryservice, as shown in Figure 2:
Figure 2 Accountqueryprocess Process implementation
In the Business integration view, drag accountqueryprocess from Business Logic into Assembly diagram,wid will generate SCA components implemented with that BPEL.
Assemble business services through Dynamic Assembly components:
Add a Dynamic assembler component to the Assembly Diagram, named "Authorserviceda", and add a Authorizationservice interface to it. Double-click the component to generate a DA implementation, as shown in Figure 3. Add a reference to the Authorserviceda for the accountqueryprocess component.
Figure 3 Authorserviceda implementation
Follow the same steps to add the Accountqueryda Dynamic Assembler component, select the Accountqueryservice interface for it, and add it as a accountqueryprocess reference. As shown in Figure 4. Right-click the Accountqueryprocess component and select "Synchronize interfaces and references" => "to implementation". Two corresponding Reference Partner are generated in BPEL.
Figure 4 Reference to DA for accountqueryprocess
Open accountqueryprocess with the Process editor, set Partner for the Authorizationservice call to the generated Authorizationservicepartner, as shown in Figure 5:
Figure 5 Setting up Authorizationservice Partner
Also set the Partner for the Accountqueryservice call, as shown in Figure 6:
Figure 6 Sets the Partner for Accountqueryservice