WS-BPEL 2.0 for SOA Composite Applications with IBM WebSphere 7 — Save 50%
Define, model, implement, and monitor real-world BPEL 2.0 business processes with SOA-powered BPM for IBM WebSphere 7 with this book and eBook
When embarking on an SOA journey, developers often come across the daunting realities of multiple programming languages, technologies, data format representation, implementation framework options, and such others, when they build services, use services, and develop solutions that aggregate services. The focus should be on programming the business and service design, not on the technology of the underlying implementation.
In this article by Matjaz B. Juric, author of the book WS-BPEL 2.0 for SOA Composite Applications with IBM WebSphere 7, we will take a look at IBM's SOA programming model.
|Read more about this book|
(For more resources on BPEL, see here.)
IBM's SOA programming model provides a set of rules and languages that lets you focus on creating an implementation of a business design. The programming model addresses the aspects of service components and the data that is exchanged between services as service data, over a service bus. Now, let us look at the key aspects of this programming model.
Service Component Architecture
We design and build applications (for example, account opening, loan underwriting, order management, customer care, customer billing, and so on) so that an organization can run their business effectively and efficiently. Applications can be looked at as a collection of software components that are assembled or integrated together for a particular purpose. Ideally, you should have the freedom to implement the different components in the technology of your choice. However, at times you may have to inherit or work with existing systems, technologies, or work with third parties who have a different set of technologies. When you adopt an SOA approach to building applications, these components can be viewed as services. When we look at the constructs that make up a service, two things immediately come to mind:
- The What part: Data that should be passed to the service and data received back from the service
- The How part: The mechanism required to realize the service and how it can be invoked or can be made available to a service consumer
For each of the previous two questions, there are many standards and programming models and, at times, it may get too overwhelming. This is where an SCA model comes in and mitigates these complexities. SCA is not another programming language or replacement, but rather gives a model to assemble and build SOA applications by choosing any technology specific to the implementation approach. The fundamental goal and premise of SCA is to separate business logic from infrastructure logic. IBM's BPM development tool WID provides the design time environment to build SCA-based applications using a bottom-up (expose services out of existing applications and make them available through the Enterprise Service Bus) or top-down approach (more a business-driven approach to identify the right set of services needed to achieve a larger goal, capability, or solution).
Therefore, WID enables architects and developers to spend more time working on solving a particular business problem rather than focusing on the details of which implementation technology to use. BPEL is one of those components that are available in WID to build applications.
SCA is a set of specifications that describes a model for building applications and systems using an SOA approach. SCA extends and complements prior approaches to implementing services and SCA builds on open standards, such as web services.
SCA divides the steps in building a service-oriented application into two major parts:
- The implementation of components (including BPEL) that expose (export) services and consume (import) other services
- The assembly of sets of components to build business applications, through the wiring of references to services
SCA uses Service Data Objects (SDO) to represent the business data that forms the request and response values of services, providing uniform access to business data to complement the uniform and consistent access to business services offered by SCA itself. SCA supports bindings to a wide range of access mechanisms used to invoke services. The complete set of SCA specifications can be found at
SCA emphasizes the decoupling of service implementation and of service assembly from the infrastructure capabilities, from technology or programming language specifics, and from the details of the access methods used to invoke services. SCA components operate at a business level and use a minimum of middleware-specific APIs. The basic elements of SCA include:
- Service components
- Service assembly
- Service data objects
The basic building block in SCA is the service component and represents a business service that publishes or operates on business data. The SCA Component Fundamental Structure figure depicts the essential pieces of a service component definition. A service component can have one or more interfaces with which it is associated. The interfaces associated with a service component advertise the business operations associated with this service. These interfaces can be specified as either Java interfaces or WSDL port type interfaces.
The arguments and return types for these interfaces are specified as simple Java types, Java classes, SDOs, or XML Schema (for WSDL port type interfaces). Also, implementation is associated with a service component definition. As the figure indicates, there are multiple language and component types available for implementing a service component.
When specifying a component interface, you cannot mix Java and WSDL port type interfaces on the same service component definition.
A service assembly deals with the aggregation of components and the linking of components through wiring or wires. Think of the assembly model as how, when building a kitchen, you would assemble various components including kitchen cabinets, sink, appliances, counter top, and so on. The assembly model is independent of implementation language. An analogy would be, you don't care how and where the dishwasher is engineered, manufactured, and built, but rather focus on the features, functions, and durability.
As depicted in the following figure, an SCA-based application Order Handling System can be made up of one or many modules and hence one or many components. Components can be combined into composites , a logical construct. In the following figure, we can see that the Order Handling System is made up from two composites, an Order Processing Composite and a Third-Party Shipping Composite.
In WID, a composite can be compared to a Service Module, which in essence becomes the basic unit of deployment and administration in WPS or WESB (SCA runtime). A service module typically contains the following artifacts:
- Module Definition
- An SCA-specification-defined deployment model for packaging components into a service module. In WID, the sca.module file contains the definition of the module.
- In the following figure, the Order Processing Composite and Third-Party Shipping Composite are the modules.
- Service Components
- Each service component can be implemented in various ways (BPEL, Mediation Flow Component, State Machine, Java, and so on), specified by the implementation definition.
- Service components can invoke other service components or imports, defined in the current service module as defined by an appropriate reference.
- A component can have 1..N interfaces.
- Each service component definition can have zero or more references to other services.
- In the following figure, the Order Validation Component and Order Handling Component are the service components whose implementations are BPEL and state machine respectively.
- In WID, the service component definition is included in the <SERVICE_NAME>.component file.
- Imports and Exports
- Allows SCA components in one module to invoke SCA components in other modules.
- A service module can have zero or more imports included with it.
- Imports have a name and a set of 1 . .N interfaces.
- A Binding attribute describes how the external service is bound to the current module.
- Once an import has been defined, other services within the module can reference the imported service as if it was a regular service component defined in the module.
- In the following figure, the Order Handling Component imports a component from the Third-Party Shipping Composite via a reference.
- In WID, import definition is included in an <IMPORT_NAME>.import file.
- Imports can use the following bindings, which can be remote or local:
- Web service
- Messaging (JMS, MQ JMS, generic JMS, MQ)
- Stateless session bean
- Allows SCA components in a module to expose their capabilities to components in other modules.
- In order to invoke any of the services in the order handling application by any client (SCA or non-SCA), the service must be exposed with an export.
- A service module can have zero or more exports included with it.
- Export components include a name and a target attribute.
- A Binding attribute describes how the service is bound externally.
- In the following figure, the Order Validation Component has an export named Order Validate Export.
- In WID, import definition is included in an <EXPORT_NAME>.export file.
- Exports binding can be:
- Web service
- Messaging (JMS, MQ JMS, generic JMS, MQ)
- Stateless session bean
- Interfaces, Business Objects, Java classes, and other components
In order to invoke any of the services in the Order Handling System by any client (SCA or non-SCA), the service must be exposed with an export. A service module can have zero or more imports included with it. An import is used to access services that are outside the current SCA module. Once an import has been defined, other within the module can reference the imported service as if it was a regular service component defined in the module.
As depicted in the following figure, the service module Order Processing Composite can have zero or more exports included with it. An export is used to expose a particular service to clients, outside the current SCA module. A service may also include a stand-alone references file that includes references to services in the module that can be used by SCA and non-SCA services.
An SCA service module is packaged and deployed to the native SCA container strategy provided by WPS. This capability allows a developer not to use any to generate runtime-specific artifacts prior to installing a module. Unlike the previous releases of WPS and WESB, with version 7.0 the native container provides greater performance improvements due to the elimination of ejbDeploy for standard SCA applications.
eBook Price: $41.99
Book Price: $69.99
|Read more about this book|
(For more resources on BPEL, see here.)
Service data objects
SCA gives us a universal model to define business services. The SDO provides the technology to represent a universal model for data that flows between components in an SCA. Each SCA component pass and exchange data with each other in a neutral fashion by passing SDOs. Data objects are the preferred form for data and metadata in SCA. The fundamental concept in the SDO architecture is the data object, a data structure that holds primitive typed data and/or other data objects. The data object also holds references to metadata that provide information about the data included in the data object.
SDOs allow the integration developer to focus on working with business artifacts. In fact, service data objects are transparent to the integration developer. They are defined by a service data object's Java Specification Request (JSR) and for more information refer to the link as follows, http://www.jcp.org/en/jsr/detail?id=235
In the SDO programming model, data objects are represented by the commonj.sdo.DataObject Java interface definition. This interface includes method definitions that enable clients to get and set the properties associated with the DataObject. Another important concept in the SDO architecture is the data graph, a structure that encapsulates a set of data objects. From the top-level data object contained in the graph, all child data objects are reachable by traversing the references from the root data object. Another important feature included in the data graph is a change summary, which is used to log information about what data objects and properties in the graph have changed during processing. The WebSphere Process Server implements the SDO specification by way of business objects.
SCA components can exchange data by passing around business objects as shown. The following figure is a mindmap that summarizes the various concepts behind an SCA application.
Please take time to go through it and recollect some of the concepts explained in the previous sections.
Common business process implementation types
Some of the common implementation types of business process that can be implemented using WPS include:
- GUI Intensive Process
- Navigational flow and data aggregation is controlled from a user interface layer rather than in a BPEL process in WPS.
- WPS is not involved in process navigation, but may be used to provide swiftly responding synchronous services.
- Use for cases where a GUI application performs the process orchestration or control.
- Synchronous Transactional Process
- A slight extension to the GUI Intensive Process type. A collection of short-running BPEL processes provide real-time responses to graphical user interfaces or for transactional subprocesses.
- Transactional and therefore, it must complete within the global timeout. No state is persisted by the process.
- Errors are typically translated for clarity and then passed back to the caller.
- Use for cases when you need high performance and the caller needs a response immediately.
- Asynchronously Initiated Transactional Process
- The caller transaction is minimal and just makes a request, but does not wait for a response. The process is assured to occur at a later time in a separate transaction.
- The caller seeks feedback via notifications or e-mail.
- Error handling is more complex than a simple Synchronous Transactional Process, since the caller is no longer present to take action.
- Use for cases when you need high performance and the caller does not need a response immediately, but only an acknowledgement.
- Briefly Persisted Process
- A special use of a long-running process, where the process completes relatively swiftly. The process lifespan is deliberately short (seconds, maybe minutes), such that process versioning issues can be avoided.
- The process must be designed to complete in a timely fashion, so no human tasks are allowed and error handling actions should be pushed out of the process. It may not receive inprocess events.
- Allows parallel processing, so it is good for aggregation. This is one of the most common motivations for this usage type.
- When choosing this pattern of business process place extra care and emphasis on exception handling to handle multitransaction scenarios
- A Synchronous Transactional Process is always preferable, if at all possible. For Briefly Persisted Processes, persistence adds a significant overhead and the error handling is much more complex.
- Use for cases where the process will take a long time (more than the runtime transaction timeout) and the process instance can be flushed through to enable simple maintenance.
- Versioned Long-lived Process
- A true long-running process that will last a relatively long time (days, weeks, and so on). Process instances will always be present in the systems, so the complex issues of process versioning will be taken into account.
- Can contain human tasks and complex error handling, such as compensation.
- May receive in-process events, which need to contain sufficient information to be correlated with the existing process instance.
- Invocation typically does not provide a response and latebinding techniques need to be well understood.
- Activities can be set to wait for manual intervention on error.
- Use for cases where the process will take a long time (more than the runtime transaction timeout) and the process contains external system interactions.
- Task-Based Process
- Used to balance multiple tasks between a number of different users, possibly in different teams/departments.
- Necessitates long-lived processes and hence must consider process versioning issues.
- Allows progressive automation of tasks.
- This is a very broad category still and can be broken into four sub-types:
- Structured Workflow
- Case Handling
- User Modeled Flows
- Used for cases where the process will take a long time (more than the runtime transaction timeout) and the process contains human interactions.
In this article we took a look at the fundamental SOA programming model concepts and understood how these concepts apply in the context of WID/ WPS/WESB.
- IBM's BPM BlueWorks [article]
- Scopes in Advanced BPEL [article]
- BPEL support in WebSphere [article]
- Human Interactions in BPEL [article]
- Business Processes with BPEL [article]
- Fault Handling and Signaling in Advanced BPEL [article]
eBook Price: $41.99
Book Price: $69.99
About the Author :
Matjaz B. Juric holds a PhD in Computer and Information Science. He is a Full Professor at the University of Ljubljana and head of the Cloud Computing and SOA Competence Centre (http://www.soa.si). Matjaz is a Java Champion, IBM Champion, and Oracle ACE Director. He has more than 15 years of work experience. He has authored/co-authored "Do More with SOA Integration, WS-BPEL 2.0 for SOA Composite Applications, Oracle Fusion Middleware Patterns, Business Process Driven SOA using BPMN and BPEL, and Business Process Execution Language for Web Services "(English and French editions). He has also authored/co-authored "BPEL Cookbook: Best Practices for SOA-based integration and composite applications development" (award for best SOA book in 2007 by SOA World Journal), "SOA Approach to Integration, Professional J2EE EAI, Professional EJB, J2EE Design Patterns Applied", and .NET Serialization Handbook. He has published chapters in More Java Gems (Cambridge University Press) and in Technology Supporting Business Solutions (Nova Science Publishers). He has also published in several journals and magazines and presented at conferences. Matjaz has been involved in several large-scale projects. In cooperation with the IBM Java Technology Centre, he worked on performance analysis and optimization of RMI-IIOP, an integral part of the Java platform.