IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Enterprise Service Bus programming
Imports and exports
The components used for SCA module to module and SCA module to external service invocation are called imports and exports. Imports and exports are represented from the point of view of the module.
A module exports its capability when it provides the ability for an external service or module to invoke an operation on a defined interface. Using exports, a module can be made available over a number of different transport protocols.
The module imports a function to use the ability of another entity (external service or module). Using imports, a module can interact with service providers across a variety of transport protocols. Figure 1.shows an import and export within an SCA module.
Figure 1. SCA module
Imports and exports also have the ability to interact with service providers across a variety of protocols and Application Programming Interfaces (APIs), such as:
- SCA (used for SCA module to module)
- Web service
- JMS
- MQ
- HTTP
- Enterprise JavaBeans
Figure 2.shows how module to module communication can be achieved using imports and exports. The StockQuote service exposes its implementation using an export. The PortfolioManager module invokes the StockQuote implementation using an import.
Figure 2. Module to module communication using imports and exports
When imports and exports are bound to protocols such as JMS, Enterprise JavaBeans, or web services, the specific clients can invoke an SCA module, or an SCA module can invoke an existing Enterprise JavaBeans, JMS messaging engine or web service using the SCA programming model. A module can use different protocols to communicate, as displayed in Figure 3.
Figure 3. Module using different protocols to communicate
Import and export bindings must be configured to control invocations, and to control how data is handled across SCA module bindings. These are the common configuration options available across bindings:
- Function selectors
- Data handlers
- Fault selector
- Fault handler
- Context propagation
- Exception handling
- Function selector
The function selector determines which operation defined on the associated interface is invoked.- Data handler
Data handlers are reusable transformation logic in WebSphere ESB, which can be used by exports and imports. Data handlers can transform native formats into business data and from business data into native formats required by external services.- Fault handling
You can configure your import and export bindings to handle faults (for example, business exceptions) that occur during processing by specifying fault selectors and fault handlers. The fault selector determines whether the response message is a normal response, a business or runtime fault that is received by an import. A fault handler processes fault data and transforms it into the correct format to be sent by the export or import binding.
- Context propagation
Context propagation allows information associated with an invocation to be carried throughout a request or response.- Exception handling
Within an import or export, unexpected situations cause exceptions to be raised. The way in which the binding is configured determines how exceptions, raised by data handlers or data bindings, are handled.- Retry configuration
SCA uses a service integration bus to transport messages between components, imports, and exports. These destinations are created by installation tasks when a module is installed to a WebSphere ESB server. If the target service component returns a system error, the service integration bus automatically resubmits the message until a threshold on the module destination is reached (the default retry threshold is 4).