XTech 2005: XML, the Web and beyond.

Business Process Context

Discuss this paper on the XTech wiki
View XML source for this paper

Keywords

Abstract

As Web Services and their interactions evolve, a woven, dynamic fabric of services is emerging. Though the interactions may be described using emerging process languages such as WS-BPEL, the run-time infrastructure must also improve to support this new dynamism. Beyond security and reliability, the new fabric requires an overall context management solution and, in many cases, the capability to coordinate and manage composed services and complex transactions. Web Services Composite Application Framework (WS-CAF) is an emerging solution in this area. This paper will cover the work of one OASIS TC and show how it fits into a Service Oriented Architecture (SOA).

Recognizing the future infrastructure requirements implied in the many concurrent standards efforts around business process description, choreography and collaboration using Web Services, Arjuna, Fujitsu, IONA Technologies, Oracle and Sun Microsystems released WS-CAF in July 2003. This framework provides a set of Web Services specifications for context propagation (WS-Context), process coordination (WS-CF) and distributed transaction management (WS-TXM). These royalty-free specifications form a critical part of SOA. Other user communities, standards, and specifications can also leverage them (e.g., for composition, choreography, and security).

The next wave of Web Services and SOA-supporting products will concentrate on management, choreography and security. They will likely all also require some or all of the facilities offered by WS-CAF. For example, choreography involves requirements for coordination and management of complex processes; WS-CAF satisfies these requirements. However, in their current work, the WS-BPEL and WS-Choreography specification developers are not explicitly addressing how context, transactions and coordination services are provided but their emerging standards assume these services are available.

This paper describes the current process language landscape and the value WS-CAF adds when these languages are in use.

Introduction

A composite application is defined as a collection of Web services operating in support of a shared purpose. For example, the services may execute a (specified) sequence of operations on a database, display, XML document or “requisition to pay” process instance. In general, composite applications are increasing in importance as companies combine Web services into new applications. Various mechanisms are being proposed and delivered to market daily to help improve this process. New “fourth generation” language development tools are emerging that are specifically designed to stitch together Web services from any source, regardless of the underlying implementation.

A large number of vendors are starting to sell business process management, workflow and orchestration tools for use in combining Web services into automatic business process execution flows, often targeted for enterprise integration. And finally, a growing number of businesses find themselves creating new applications by combining their own Web services with others available from the Internet.

These types of composite applications represent a variety of requirements, from sharing persistent data in a simple manner to managing recovery scenarios that include various types of transactional software. Composite applications therefore represent a significant challenge for Web services standards since they are intended to handle complex, potentially long-running interactions among multiple Web services as well as simple and short-lived interactions. Further, distributing choices across multiple enterprise environments or partners creates additional challenges for effective execution of their bidirectional interactions.

Although standard interaction protocols such as XML and SOAP provide the basic means for development and use of web services, exercising the full power of Web services as an integration platform can only be realized when there is also a standard process integration model to assist in the construction of composite applications. In July 2002, BEA, IBM, and Microsoft released BPEL4WS (Business Process Execution Language for Web Services, BPEL4WS), which was intended for separating the process flow from the compiled code of Web services-based applications and automating an engaged party's view of a process. An updated version of this specification (BPEL4WS1) has since been submitted to the OASIS WS-BPEL BPEL technical committee (TC) for the purpose of developing an open standard in this domain.

The value of WS-BPEL is the orchestration and refinement of the individual services and their containing processes that make up a business application are critical to an enterprise’s viability in the marketplace. Those businesses whose processes are agile and flexible will be able to adapt rapidly to and exploit new market conditions.

Though the interactions between processes may be described using languages such as WS-BPEL, the run-time infrastructure of Web Services must also improve to support this new dynamism and the languages themselves. Beyond security and reliability gaps frequently cited in Web Services technologies, the new fabric requires an overall context management solution and, in many cases, the capability to coordinate and manage composed services and complex transactions. Certain assumptions are, for example, made at the process level about these underlying infrastructure capabilities to support distributed processes within or across enterprises and partners. The design- and run-time infrastructures are two sides of a coin that must improve in tandem.

The work of the OASIS Web Services Composite Application Framework (WS-CAF, CAF) is intended to address some of the shortcomings of the current Web Services architecture imperative to achieve SOA. The WS-CAF suite includes three specifications that can be implemented incrementally to address the range of requirements needed to support a variety of composite applications:

WS-CAF specifications are designed to complement emerging Web services orchestration and choreography technologies such as WS-BPEL BPEL and WS-CDL (W3C WS-Choreography WG’s Choreography Description Language, CDL) and are compatible with other Web services specifications. The emphasis of WS-CAF is on defining services that Web services used in combination require, including support for other specifications.

In order to understand the arena in which WS-CAF is intended to operate, in the next section we’ll look at a real-world example of constructing a business-to-business interaction. This will illustrate the requirements constructing a composite application currently impose on developers. In other distributed architectures such as CORBA and J2EE, these constraints are met by the infrastructure.

Use case

Robert's Rubber and Penny's Pencils have been doing business for quite some time electronically and over the Internet. Both companies agree with the oft-heard refrain "I am not in the IT business" and wish to transition to a more standard, off-the-shelf infrastructure. They are hoping new process technologies such as WS-BPEL will get them both most of the way there.

Rob and Pen currently are working within a 5 year contract that calls out their roles, responsibilities and expectations. This legal document does not discuss particular technologies or service (as in "Internet protocol") level agreement terms. It does, however, describe expected document exchanges, time lines for each and the related delivery of goods.

The particular documents exchanged on a regular basis and the terms under which they are exchanged are "relatively" simple due to the repeated nature of the purchases and the smoothness of their historical relationship. Both companies wish to avoid additional complications and new technical problems as they transition to a new document exchange protocol.

At the moment, our pencil manufacturer (the buyer) orders varied amounts of rubber from a fixed catalog, expects order receipt acknowledgment within a business day and goods delivery within 3 business days. While our rubber provider (the supplier) may occasionally notify the manufacturer of a delay, this notification always occurs within the first business day after Rob receives the order. Under the terms of their agreement and while both Rob and Pen may cancel and Rob may refuse an order within that important first day, neither may modify an order. The companies are using Evaluated Receipt Settlement (ERS), meaning Rob never sends invoices and Pen sends good receipts. The actual payment involves direct deposits their banks handle directly, out of band with respect to this business document exchange.

The particular business documents involved in this relationship include purchase order, cancel order, shipment advice, goods receipt and acknowledgments. Rob sends the acknowledgment and shipment advice documents, receives all of the others. The high level business process outline appears in Figure 1.

Overall relationship between the buyer (Penny) and seller (Robert)

Robert and Penny have heard a great deal about service oriented architectures and the web services implementation of that model. They want to get on this wonderful bus. What should they do?

Business process descriptions

Traditional methods for integration of business transactions typically involve embedded logic inside functionality oriented IT applications. The development, testing and deployment effort required to change these applications make integration and process changes very costly and complex. To address these issues, proprietary EAI and Business Process Management (BPM) products emerged in the 1990s to abstract integration and process automation. These software products (workflow systems) liberated the integration and process tasks from the underlying functional IT applications so they could more effectively be changed, managed and optimized.

Workflows are rule based management software that direct, coordinate and monitor execution of tasks arranged to form workflow applications representing business processes. Historically, those systems integrated the human workflow inherent in business operational flows. A workflow schema is used to explicitly represent the dependency between the tasks and in many ways may look like a traditional programming language, with branch statements, conditional executions etc.

Newer and planned products incorporate WS-BPEL to describe the process execution of a particular component. One area where WS-BPEL may be applied is shown in Figure 2.

Where WS-BPEL may fit in

For example, let’s consider the business process interactions occurring when our pencil manufacturer (Pen) works with Rob. From Robert's perspective, this may be modeled as a compound task processOrderApplication which contains four constituent simple task instances:orderAuthorization (will Rob accept orders from this buyer?), checkStock (does Rob have sufficient supplies?), sendResponse (as necessary send a shipment advice, order cancellation, or order refusal) and executeDelivery (start movement of the goods). The relationship between the tasks is shown in Figure 3.

Process order application example

To process an order, orderAuthorization and checkStock tasks are executed concurrently. If both complete successfully then the sendResponse task is started and if that task is successful then the executeDelivery task is started.

The above description focused on a particular component within Rob's infrastructure. As shown in Figure 4, Robert's Rubber likely includes multiple components that must be described and connected. WS-CDL describes this “global view” – the links between these components. This global view does not require all components share a common set of operation names or message schema and supports mapping between the provided interfaces. As noted in the WS-CDL specification CDL (Section 1.5), the choreography language does not require even all components utilize WS-BPEL.

The language itself builds upon roles (observable behavior of participants) and the channels (where and how the participants exchange information) between them. In our example, WS-CDL is used to link the orderAuthorization and checkStock interactions with corresponding interactions at the external coordinator. This allows each participant to monitor the overall choreography as well as their process execution within it.

WS-CDL links multiple components described using WS-BPEL

Such a global view is also useful elsewhere in our business scenario. However, the description of the messages (documents and signals) exchanged between Penny's Pencils and Robert's Rubber includes business terms and conditions as well as a different (less generic) version of the global view. This information, primarily focused on the business (not technical) constraints of the collaboration and often related to legal intent, is captured in or referenced from an ebXML Business Process Specification Schema ebBP. While an ebBP instance may describe message schema and decision points, the emphasis remains upon the business documents and constraints (such as time to perform) which may not involve later message exchanges. The scope of the ebBP instance describing Rob and Penny's collaboration is shown in Figure 5.

ebXML BPSS describes the business collaboration

Run-time infrastructure

Given the previous example, let’s now look at the requirements imposed on Web services applications that involve multiple participants (e.g., within Rob's back office) and hence multiple services. The intention is to show the additional effort imposed on application developers at present because of the lack of significant support from the infrastructure for these requirements.

External message exchanges may require additional or somewhat different business process descriptions from internal interactions as shown in the previous section. Similarly, internal and external systems may place slightly different requirements upon the run-time infrastructure. Where the needs clearly differ, we call those differences out below. The broad strokes are somewhat intuitive: External systems often begin with a widely-understood document syntax; internal ones are more likely to require distributed transactions (infrastructure level coordination rather than application-controlled message exchanges). Fortunately, a large portion of the requirements are common.

Message correlation

During a business activity such as that with Rob and Pen, a given process will often interact with many different partners in order to conduct work. Those interactions may be based on various transport mechanisms. However, the typical interaction pattern is based on one way messages, rather than the traditional synchronous remote procedure call paradigm, because this allows loose coupling of application entities; the sender of a given message that requires a response need not be the same as the ultimate receiver of that response. This allows for great flexibility in choosing service deployments, particularly in environments that may be error prone, require dynamic changes to roles and responsibilities, or support entities that assume several roles in related interactions.

However, if interactions are structured as one-way messages, some means of tying a response to a request is required obviously required. Furthermore, in some situations it may be a requirement for multiple requests to be sent to a service but only one response is required. Rob's online computer ordering service may, for example, combine a day's worth of Pen's orders (N*purchase orders) until the requested goods are finally dispatched (one shipment advice). In this case, Rob chooses when to combine requests into fewer responses. Pen would be driving a similar choice if our use case involved change orders (initial order + N*refinements resulting in a single shipment).

These requirements can be summarized as requiring messages to be contextualized: Additional information must be associated with a message to enable the infrastructure to “route” the message (physically or logically).

An obvious way in which this matching could be done would be through the use of additional information associated with the messages (e.g., a message sequence number). However, this has the following disadvantages:

For example, let’s return to Rob's order processing scenario and look at the possible message interactions between the various processes, as shown via the UML interaction diagram in Figure 6. Here we’ve added an Order Process Orchestrator, which is meant to represent the overall controlling aspect of the flow. As you can see, in this example we’ve modeled all interactions as one-way operations.

Because we are using one-way operations, it’s necessary to correlate requests and responses. For example, if you look at the interaction between the Order Process Orchestrator and the Order Authorization Process you can see the getOrderAuthorization request and the orderAuthorization response. The order process workflow will probably be dealing with many client order requests concurrently, so the Orchestrator will be sending and receiving many getOrderAuthorization and orderAuthorization messages.

Message interactions for the process order example

More than just correlation data could be carried in the context. For example, some applications may find it beneficial to include frequently changing data (e.g., a shopping cart) within the context, rather than having to access this information through an explicit lookup or some other mechanism. However, if this information is large (e.g., bitmaps, documents etc.), it may be a performance penalty to include this information directly in the context; the context information could end up dominating the message transmission time. Therefore, some way of passing context information "by reference" in these situations would be beneficial.

Coordination

The coordination aspects of our example business interaction are obvious: driving the process flow from order authorization, through a decision point to final product shipment requires some form of coordinator/orchestrator process. In a failure free environment this can be fairly simple and straightforward to achieve, but requires substantial infrastructure support otherwise. For example, in order to tolerate failures, the coordinator must durably remember the participants in the flow (the processes/services to invoke); where the flow has reached in the overall application and how to deal with lost or duplicate messages.

Likewise more than one type of coordination protocol may be required. For instance, the flow in the above example shows a relatively simply set of interactions between singleton processes, i.e., each message is sent to only a single recipient. However, there are situations were a more complex interaction pattern may be required; for example where orderAuthorization and checkStock must both occur or neither occur. In this case the coordination protocol used would have to be multi-phase in order to achieve consensus between the processes involved.

The coordination protocol could ensure the checkStock occurs for the order to be initiated and continued. In specific context, the order may not be initiated if the stock is not available. In a broader sense, coordinating across multiple entities may require a corresponding protocol to accommodate, for example, the distributed choice of each and their influence on the process outcomes.

Transactions

The concept of atomic (ACID) transactions has played a cornerstone role in creating today's enterprise application environments by providing guaranteed consistent outcome in complex multiparty business operations and a useful separation of concerns in applications. However, it has long been realized that traditional transactions by themselves are not adequate for structuring long-lived applications like that which Rob and Pen epitomize (). Most business-to-business applications require transactional support in order to guarantee consistent outcome and correct execution. These applications often involve long running computations, loosely coupled systems and components that do not share data, location, or administration and it is thus difficult to incorporate traditional transactions within such architectures.

Given that the traditional ACID transaction model is not appropriate for Web services, let’s pose the question, “what type of model or protocol is appropriate?” The answer to that question is that that no one specific protocol is likely to be sufficient, given the wide range of situations where Web service transactions are likely to be deployed.

The problem with this answer for the likes of Rob and Pen is that they aren’t transaction experts and have more pressing things to do, like implement the functional aspects of their new Web services application. What they need is support from the infrastructure so that transactions are simply an all pervasive fact of life, something which they can choose to use without too much effort. The mechanisms used to compose, correlate and constrain the execution and coordinating their processes may not be visible to these two partners, but the capability and flexibility to meet their changing business obligations are. A similar requirement arose in other environments, such as CORBA OTS and J2EE JTS.

Using WS-CAF to address the requirements

Given the previous sections and the example of Rob and Pen (), we’ve seen the integral requirements for building composite business applications using Web services. In the following sections we’ll indicate how the WS-CAF work is helping to define the solutions to these requirements.

Correlation

In order to correlate the work of distributed participants within the same activity, it is necessary to propagate additional information (the context) to participants. The context contains information such as a unique ID that allows a series of operations to share session data. For example, a SOAP header block might contain context information that is propagated when interacting with a service, or when multiple participants exchange SOAP messages in order to create a larger interaction such as a process flow or other aggregation of Web services.

Context propagation is a fundamental requirement of many distributed systems, including Web services MCL04. However, the type of context information that is used may vary depending upon the circumstances, e.g., in an atomic transaction system it may be a URI for the coordinator; whereas for secure data interchange it may be the sender’s public encryption key. In the business process arena, execution of a business process and handling the complexity of multi-party collaborations also requires careful context management. Therefore, what is needed is standardization on a context framework that allows services to register with it and customize it on a per activity basis.

The WS-Context specification defines such a context service. It can be used by arbitrary Web services to form composite applications. Contexts are first-class elements, i.e., the context information is represented as a Web resource, accessible via its URI. Contexts may flow implicitly (transparently to the application) with normal messages sent to participants/endpoints during Web service execution, or may need an explicit action on behalf of a participant.

WS-Context defines the notion of an abstract activity to which the context is bound: the lifetime of the activity is the lifetime of the context. So, we can (for example) use an activity to model a session: all interactions on a session-oriented service in the scope of an activity will be uniquely and unambiguously tied to that activity through the context. An activity may also model a business process instance, a conversation, and other concepts.

One of the common features of all middleware systems is support for the session concept. A session is a mechanism for correlating multiple messages in order to achieve some application-visible semantic. This is typically done on behalf of a client within a service endpoint. In general, middleware systems decouple session association from specific communication channels to improve robustness. To achieve this, the session model is layered on top of a communication channel that links the client to network-visible application services. Many middleware systems advertise the session model explicitly as a mechanism for client applications to manage stateful conversations or communicate with stateful “resources”. In other cases, the session concept is maintained less explicitly to support system services that are provided to applications.

For example, a context might begin:

<context>
	<type=MyContext/>
	<context-identifier>
		http://www.webservicestransactions.org/example/XTECH2005
 	</context-identifier>
</context>
       		 

The activity might require user authentication. For example, as we mentioned, the interactions between Bob and Pen require some kind of authentication information. To facilitate single sign-on throughout the composite application, the context might be extended to include user information and provided as an input to the first Web service in a WS-BPEL defined flow. The first Web service in the flow would check the username and password (the asterisks are used to indicate opaque data in the example below) and generate an authentication token. Such an authentication token would be placed back into the context data structure, augmenting the original structure. This token (rather than the username and password) is used for subsequent checks of whether the user is authorized to access other Web services in the flow.

The augmented context might contain the following:

           <extended-context>
            <user-name>Rob</user-name>
            <AuthToken>********</AuthToken>
           </extended-context>

As illustrated, the context is a living data structure; the results of a security sign on (or other operations pertinent to the contents of the context) would typically be added for propagation to the next Web service in the flow. For example, a single sign-on system bridging multiple security domains could add another token to the context.

Another potential way of achieving the session concept would be through the use of WS-Addressing ADDR ReferenceProperties/ReferenceParameters. Unfortunately this approach tightly couples sessions to endpoint references. Clients cannot switch or alter the interaction semantic with respect to the service. Clients must maintain a special reference on a per-relationship basis with each service, further coupling the service client and the service itself. This has two important consequences: it creates a brittle relationship between the client and the network service in which the client’s understanding of the service is limited to a particular session. Termination of that session invalidates the client’s communication channel to the service. Secondly, this results in a scalability problem: clients must contain special reference-pointers to services for each relationship that is linked by the session. Often this results in the unnecessary management and storage of redundant data.

As in other distribution environments where the reference session model is used (e.g., CORBA or J2EE), the remote reference (address) that the client has to the service endpoint must be remembered by the client for subsequent invocations. If the client application interacts with multiple services within the same logical session, then it is often the case that the state of a service has relevance to the client only when used in conjunction with the associated states of the other services. This necessarily means that the client must remember each service reference and somehow associate them with a specific interaction; multiple interactions will obviously result in different reference sets that may be combined to represent each sessions.

On the other hand, WS-Context allows a service client to more naturally bind the relationship to the service dynamically and temporarily. The client’s communication channel to the service is not impacted by a specific session relationship. This has special implications as we consider scaling Web services from intra-domain deployments to general services offered on the Internet.

Coordination

WS-CF is the middle layer in the WS-CAF set of specifications whose aim is to provide an extensible framework that supports a wide range of different coordination protocols (e.g., two- or three-phase commit).

The fundamental idea underpinning WS-CF is recognition of a shared and generic need for propagating context information in a Web services environment, irrespective of the applications involved. The WS-CF specification defines a framework that allows different coordination protocols to be plugged-in to coordinate work between clients, services and participants, as shown in Figure 7.

WS-CF Architecture

The WS-CF specification talks in terms of activities, which are distributed units of work, involving one or more parties (which may be services, components, or even objects). At this level, an activity is minimally specified and is simply created, made to run, and then completed.

Whatever coordination protocol is used and in whatever domain it is deployed, the same generic requirements are present:

The first two of these points are directly the concern of WS-CF, the third is obtained through the use of WS-Context, while the fourth is the responsibility of a third-party entity, usually the client application that controls the application as a whole.

Transactions

We’ve already seen that the structuring mechanisms available within traditional atomic transaction systems are not sufficient for all of the complex business interactions that are likely to arise (for Pen and Bob for instance) and that multiple transaction models are necessary. As a result, WS-CAF builds on the extensibility aspect of WS-CF with the WS-TXM specification, which defines the following models:

Conclusions

We have discussed a relatively simple use case that is incredibly common due to its simplicity. Even in its simplicity, requirements for business process description and protocol emerge. Our survey of emerging description languages and discussion of WS-CAF demonstrates that these requirements are being met.

WS-CAF is an emerging set of specifications that provides the run-time infrastructure support for emerging business process description languages. The specifications also support requirements of composite applications in their own right. The two sides of the coin (description languages and run-time infrastructure) are emerging in a balanced fashion but remain separately useful.

The WS-CAF specifications are designed to work with and complement other Web services protocol specifications, including WS-Security, WS-Reliability, and others. The WS-CAF specifications define the SOAP message exchange patterns and WSDL interfaces necessary to accomplish the context management, coordination, and transaction processing capabilities needed to support composite application executions.

Specifications such as BPEL and WSCI provide the mechanism for extending the WSDL layer to identify a series of Web services; WS-CAF defines the complementary system layer necessary to ensure that the multiple Web services achieve the desired results of the application, and that the cooperation of multiple Web services from whatever source produces predictable behavior despite system failure.

As with most aspects of standardization, the value in WS-CAF is derived from the potential for Web Serevices vendors to provide its features and functions, thereby helping application developers solve composite application problems more easily. Once adopted and implemented, the functionality contained within WS-CAF will not only be available as part of the platform (and therefore not have to be coded as part of the application) but also it will be available in a standard way across platforms, allowing Web services from multiple environments to interoperate more easily, efficiently, and effectively than if the developers had to code all of the equivalent features and functionality themselves in a non-standard way.

Acknowledgements

Our thanks to Monica Martin of Sun Microsystems, Inc. Thanks also to the members of the OASIS WS-CAF technical committee.

Bibliography

[ACID] Transaction Processing: Concepts and Techniques
Morgan Kaufman, 1993
[ADDR] Web Services Addressing (WS-Addressing)
W3C, August 2004
[BPEL] The OASIS Web Services Business Process Execution Language Technical Committee
[BPEL4WS] Business Process Execution Language for Web ServicesServices, Version 1.0
31 July 2002
[BPEL4WS1] Business Process Execution Language for Web Services Version 1.1
5 May 2003
[CAF] The OASIS Web Services Composite Application Framework Technical Committee
[CDL] Web Services Choreography Description Language Version 1.0
27 April 2004
[Context] Enabling Open, Interoperable, and Smart Web Services (The Need for Shared Context)
12 March 2001
[ebBP] The OASIS ebXML Business Process Technical Committee
[JTS] Java™ Transaction Service 1.0
8 December 1999
[MCL04] Stateful Interactions in Web Services
May 2004
[OTS] Object Transaction Service, v1.4
Object Management Group2 September 2003
[State] State Alignment in the connected world
22 June 2004

Biography

Mark Little

Chief Architect, Transactions, Arjuna Technologies

Mark Little was a part of the core research team at the University of Newcastle where the first distributed object transaction system was developed. He worked on the definition of the OMG Object Transaction Service and authored the first available implementation of the standard. He cofounded Arjuna Solutions, a company specializing in transactional Java products, which was acquired by Bluestone Software. He later led the transaction teams at Hewlett Packard Corporation, where he was a Distinguished Engineer. Along with other colleagues, Mark spun out Arjuna Technologies from HP, and continues as their Chief transactions architect. He is active in the Java Community Process, OASIS, W3C and the OMG and is one of the authors (and editor) of the WS-CAF specifications.

Biography

Doug Bunting

XML Standards Architect, Sun Microsystems, Inc.

Doug represents Sun in a number of standards venues with a current focus on W3C and OASIS efforts. He presently represents Sun on the OASIS WS Composite Application Framework Technical Committee (TC), OASIS Business Transactions TC, OASIS WS Reliable Messaging TC, OASIS ebXML Messaging TC and WS-I Requirements Working Group.

Before joining Sun, Doug was Ariba's manager of the cXML supply chain protocol for business documents in B2B interactions. Prior to that, Doug was Intuit's liaison to the OFX and IFX consortia for personal finance connections to banks and internal banking connections. In ancient history, Doug consulted on a large number of database projects, including design and development work on Digital's RDMS suite and its SQL-based and distributed (proposed) replacement.