This topic applies only to the IBM Business Automation Workflow Advanced
configuration.

Assembling services: Customer enquiry example

Draft comment:
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-01-20 10:38
This example shows how you can assemble a service to process a customer enquiry.
When the customer ID is supplied, the customer's portfolio information is returned. Processing this enquiry requires two additional services: one to access the customer's account information and another to find out the current stock price. The following picture shows this solution:
In the customer enquiry example, three components provide the required business services:
  • CustomerQuery accepts a customer ID as input and invokes other services to obtain customer's portfolio data and the current stock price. This service also calculates the stock values and returns them with the portfolio information.
  • CustomerInfo accepts a customer ID as input and returns the stocks and number of shares owned by the customer.
  • StockQuote accepts a stock symbol as input and returns the stock's price.

The three components require implementations that perform the processing. For example, the CustomerQuery component can be a business process that retrieves the customer portfolio information and stock price.

All three components must have interfaces so that they can be used by other components:
  • CustomerQueryInterface provides the getCustomerPortfolio operation, which accepts CustomerID as input and returns the stocks (array) and shares (array) owned by the customer and their values (array).
  • CustomerInfoInterface provides the getCustomerInfo operation, which accepts CustomerID as input and returns the stocks (array) and shares (array) owned by the customer.
  • StockQuoteInterface provides the getStockQuote operation, which accepts StockSymbols (array) as input and returns the price (array) of the stocks.
In the example, one of the components, CustomerQuery, uses the services of two other components. It has two partner references:
  • One to the interface on the target component, CustomerInfo
  • Another to the interface on the target component, StockQuote
The CustomerQuery component has two partner references and the wires point to the target components that have the referenced interfaces. The assembly diagram in the following illustration shows the three components wired together:

The implementations of components that are used in a module's assembly reside within the module. Components belonging to other modules can be used through imports. Components in different modules can be wired together by publishing the services as exports that have their interfaces, and then dragging the exports into the required assembly diagram to create imports.

You can add a stand-alone references node to provide access to the CustomerQuery service. This structure helps you to create JavaServer pages that use the stand-alone references to access CustomerQuery. In the assembly editor, the node for the stand-alone references has an arrow icon, stand-alone references icon. The following image shows the addition of the stand-alone references to access the CustomerQuery service:

Stand-alone References in the assembly editor

The following image shows StockQuote as an import rather than a component, which indicates that this service, which provides stock prices, is being supplied from another module.
Assembly module diagram

You can make the CustomerQuery service available to other modules by creating an export. The following image shows the export, CustomerQueryExport, which is created from the CustomerQuery component's interface:

the CustomerQueryExport in the assembly diagram