BPEL4WS1.1 Specification

zhaozj2021-02-16  107

Specification: Business Process Execution Language for Web Services Version 1.1

05 May 2003

This version:

http://www.ibm.com/developerworks/library/ws-bpel/

(Available in

PDF

)

Authors:

Tony Andrews, Microsoft

Francisco Curbera, IBM

Hitesh Dholakia, Siebel Systems

Yaron Goland, BEA

Johannes Klein, Microsoft

Frank LEYMANN, IBM

Kevin Liu, SAP

Dieter Roller, IBM

Doug Smith, Siebel Systems

Satish Thatte, Microsoft

Ivana Trickovic, SAP

Sanjiva Weerawarana, IBM

Editor:

Satish Thatte, Microsoft

Copyright © 2002, 2003 BEA Systems, International Business Machines Corporation, Microsoft Corporation, SAP AG, Siebel Systems. All Rights Reserved.

Copyright © Permission to copy and displaythe "Business Process Execution Language for Web Services Specification, version 1.1 dated May 5, 2003" (hereafter "the BPEL4WS Specification"), in any medium without fee or royalty is hereby granted, provided that you include the FOLLOWING All Copies of The Bpel4ws Specification, or portions thereof, That you make:

A link to the BPEL4WS Specification at these locations: http://dev2dev.bea.com/technologies/webservices/BPEL4WS.jsp http://www-106.ibm.com/developerworks/webservices/library/ws-bpel/ http : //msdn.microsoft.com/library/default.asp? URL = / library / en-us / dnbiz2k2 / html / bpel1-1.asp http://ifr.sap.com/bpel4ws/ http: // www .siebel.com / bpel The copyright notice as shown in the BPEL4WS Specification: BEA, IBM, Microsoft, SAP AG and Siebel Systems (collectively, the "Authors") agree to grant you a royalty-free license, under reasonable, non- discriminatory terms and conditions, to patents that they deem necessary to implement the Business Process Execution Language for Web Services Specification. THE Business Process Execution Language for Web Services SPECIFICATION IS PROVIDED "AS IS," aND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR Implied, include, Warranties of Merchantability, Fitness for a Particular Purpose, Non-Infringement, Or Title; That That Contents Of the bpel4ws specification is suitable for any purpose;

NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION oF THE BPEL4WS SPECIFICATION. The name and trademarks of the Authors may NOT be used in any manner, including advertising or publicity pertaining to the BPEL4WS Specification or its contents without specific, written prior permission. Title to copyright in the BPEL4WS Specification will at all times Remain with the authors. no Other Rights Are Grand by implication, Estoppel or OtherWise.Abstract

This document defines a notation for specifying business process behavior based on Web Services. This notation is called Business Process Execution Language for Web Services (abbreviated to BPEL4WS in the rest of this document). Processes in BPEL4WS export and import functionality by using Web Service interfaces Exclusively.

Business processes can be described in two ways. Executable business processes model actual behavior of a participant in a business interaction. Business protocols, in contrast, use process descriptions that specify the mutually visible message exchange behavior of each of the parties involved in the protocol, without revealing their internal behavior. The process descriptions for business protocols are called abstract processes. BPEL4WS is meant to be used to model the behavior of both executable and abstract processes.

BPEL4WS provides a language for the formal specification of business processes and business interaction protocols. By doing so, it extends the Web Services interaction model and enables it to support business transactions. BPEL4WS defines an interoperable integration model that should facilitate the expansion of automated process integration In Both the intra-corporate and the business-to-business spaces.status of this document

This is a second public draft release of the BPEL4WS specification. BPEL4WS represents a convergence of the ideas in the XLANG and WSFL specifications. Both XLANG and WSFL are superseded by the BPEL4WS specification.

Table of contents

1. Introduction2. Notational Conventions3. Relationship with WSDL4. What Changed from BPEL4WS 1.0 4.1. Core Concepts Clarification 4.2. Terminology Changes 4.3. Feature Changes5. Core Concepts and Usage Patterns6. Defining a Business Process 6.1. Initial Example 6.2. The Structure of a Business Process 6.3. Language Extensibility 6.4. The lifecle of a business process7. Partner link types, partner links,

and Endpoint References 7.1. Partner Link Types 7.2. Partner Links 7.3. Business Partners 7.4. Endpoint References8. Message Properties 8.1. Motivation 8.2. Defining Properties9. Data Handling 9.1. Expressions 9.1.1. Boolean Expressions 9.1.2. Deadline-Valued Expressions 9.1.3. Duration-Valued Expressions 9.1.4. General Expressions 9.2. Variables 9.3. Assignment 9.3.1. Type Compatibility in Assignment 9.3.2. Assignment Example10. Correlation 10.1. Message Correlation 10.2. Defining and Using Correlation Sets11. Basic Activities 11.1. Standard Attributes for Each Activity 11.2. Standard Elements for Each Activity 11.3. Invoking Web Service Operations 11.4. Providing Web Service Operations 11.5. Updating Variable Contents 11.6. Signaling Faults 11.7. Waiting 11.8. Doing Nothing12. Structured Activities 12.1. Sequence 12.2. Switch 12.3. While 12.4. Pick 12.5. Flow 12.5. 1. Link Semantics 12.5.2. Dead-Path-Elimination (DPE) 12.5.3. Flow Graph Example 12.5.4. Links and Structured Activities13. Scopes 13.1. Data Handling 13.2. Error Handling in Business Processes 13.3. Compensation Handlers 13.3. 1. Defining a Compensation Handler 13.3.2. Invoking a Compensation Handler 13.4. Fault Handlers 13.4.1. Implicit Fault and Compensation Handlers 13.4.2. Semantics of Activity Termination 13.4.3. Handling Faults That Occur Inside Fault and Compensation Handlers 13.5. Event Handlers 13.5.1. Message Events 13.5.3. Enablement of Events 13.5.4. Disablement of Events 13.5.5. Fault Handling Consider

ations 13.5.6. Concurrency Considerations 13.6. Serializable Scopes14. Extensions for Executable Processes 14.1. Expressions 14.2. Variables 14.3. Assignment 14.4. Correlation 14.5. Web Service Operations 14.6. Terminating a Service Instance 14.7. Compensation 14.8. Event Handlers15. Extensions for Business Protocols 15.1. Variables 15.2. Assignment16. Examples 16.1. Shipping Service 16.1.1. Service Description 16.1.2. Message Properties 16.1.3. Process 16.2. Loan Approval 16.2.1. Service Description 16.2.2. Process 16.3. Multiple Start Activities ...... 16.3.1 Service Description 16.3.2 Process17 Security Considerations18 Acknowledgments19 References20 Appendices 20.1 Appendix A -. Standard Faults 20.2 Appendix A -.. Standard Faults 20.3 Appendix C -. Coordination Protocol 20.3.1 Coordination Protocol for BPEL4WS Scopes 20.4. Appendix D - XSD Schemas1. Introduction

The goal of the Web Services effort is to achieve universal interoperability between applications by using Web standards. Web Services use a loosely coupled integration model to allow flexible integration of heterogeneous systems in a variety of domains including business-to-consumer, business-to- business and enterprise application integration The following basic specifications originally defined the Web Services space:.. SOAP, Web Services Description Language (WSDL), and Universal Description, Discovery, and Integration (UDDI) SOAP defines an XML messaging protocol for basic service interoperability. WSDL introduces a common grammar for describing services. UDDI provides the infrastructure required to publish and discover services in a systematic way. Together, these specifications allow applications to find each other and interact following a loosely coupled, platform-independent model.

Systems integration requires more than the ability to conduct simple interactions by using standard protocols. The full potential of Web Services as an integration platform will be achieved only when applications and business processes are able to integrate their complex interactions by using a standard process integration model. The interaction model that is directly supported by WSDL is essentially a stateless model of synchronous or uncorrelated asynchronous interactions. Models for business interactions typically assume sequences of peer-to-peer message exchanges, both synchronous and asynchronous, within stateful, long-running interactions involving two or more parties. To define such business interactions, a formal description of the message exchange protocols used by business processes in their interactions is needed. The definition of such business protocols involves precisely specifying the mutually visible message exchange behavior of each of the parties involved In The Proto col, without revealing their internal implementation. There are two good reasons to separate the public aspects of business process behavior from internal or private aspects. One is that businesses obviously do not want to reveal all their internal decision making and data management to their business partners . The other is that, even where this is not the case, separating public from private process provides the freedom to change private aspects of the process implementation without affecting the public business protocol.

Business protocols must clearly be described in a platform-independent manner and must capture all behavioral aspects that have cross-enterprise business significance. Each participant can then understand and plan for conformance to the business protocol without engaging in the process of human agreement that adds so much to the difficulty of establishing cross-enterprise automated business processes today.What are the concepts required to describe business protocols And what is the relationship of these concepts to those required to describe executable processes to answer these questions, consider the following??:

Business protocols invariably include data-dependent behavior. For example, a supply-chain protocol depends on data such as the number of line items in an order, the total value of an order, or a deliver-by deadline. Defining business intent in these cases requires the use of conditional and time-out constructs. The ability to specify exceptional conditions and their consequences, including recovery sequences, is at least as important for business protocols as the ability to define the behavior in the "all goes well" case. Long-running interactions include multiple, often nested units of work, each with its own data requirements. Business protocols frequently require cross-partner coordination of the outcome (success or failure) of units of work at various levels of granularity.

If we wish to provide precise predictable descriptions of service behavior for cross-enterprise business protocols, we need a rich process description notation with many features reminiscent of an executable language. The key distinction between public message exchange protocols and executable internal processes is that internal processes handle data in rich private ways that need not be described in public protocols.In thinking about the data handling aspects of business protocols it is instructive to consider the analogy with network communication protocols. Network protocols define the shape and content of the protocol envelopes that flow on the wire, and the protocol behavior they describe is driven solely by the data in these envelopes. in other words, there is a clear physical separation between protocol-relevant data and "payload" data. The separation is far less clear cut in business Protocols Because The Protocol-Relevant Data TENDS to Be Embedded in Other Application Data.

BPEL4WS uses a notion of message properties to identify protocol-relevant data embedded in messages. Properties can be viewed as "transparent" data relevant to public aspects as opposed to the "opaque" data that internal / private functions use. Transparent data affects the public business protocol in a direct way, whereas opaque data is significant primarily to back-end systems and affects the business protocol only by creating nondeterminism because the way it affects decisions is opaque. We take it as a principle that any data that is used to affect The Behavior of A Business Protocol Must Be Transparent and Hence Viewed As a Property.

The implicit effect of opaque data manifests itself through nondeterminism in the behavior of services involved in business protocols. Consider the example of a purchasing protocol. The seller has a service that receives a purchase order and responds with either acceptance or rejection based on a number of criteria, including availability of the goods and the credit of the buyer. Obviously, the decision processes are opaque, but the fact of the decision must be reflected as behavior alternatives in the external business protocol. in other words, the protocol requires something like a switch activity in the behavior of the seller's service but the selection of the branch taken is nondeterministic. Such nondeterminism can be modeled by allowing the assignment of a nondeterministic or opaque value to a message property, typically from an enumerated set of possibilities. The property can THEN BE Used in Defining Conditional Behavior That Captures BehaviORAL Alternative $ WITHOUT REVEALING A .

The basic concepts of BPEL4WS can be applied in one of two ways. A BPEL4WS process can define a business protocol role, using the notion of abstract process. For example, in a supply-chain protocol, the buyer and the seller are two distinct roles , each with its own abstract process. Their relationship is typically modeled as a partner link. abstract processes use all the concepts of BPEL4WS but approach data handling in a way that reflects the level of abstraction required to describe public aspects of the business protocol. Specifically , abstract processes handle only protocol-relevant data. BPEL4WS provides a way to identify protocol-relevant data as message properties. In addition, abstract processes use nondeterministic data values ​​to hide private aspects of behavior.It is also possible to use BPEL4WS to define an Executable Business Process. The Logic and State of The Process Determine The Nature and Sequence of The Web Service Interactions Conducted At Each Business Partner, And thus the interaction protocols. While a BPEL4WS process definition is not required to be complete from a private implementation point of view, the language effectively defines a portable execution format for business processes that rely exclusively on Web Service resources and XML data. Moreover, such processes EXECUTE AND INTERACT WITED WAY REGARDLASS OF THE Supporting Platform or Programming Model Used by The Implementation of The Hosting Environment.

Even where private implementation aspects use platform-dependent functionality, which is likely in many if not most realistic cases, the continuity of the basic conceptual model between abstract and executable processes in BPEL4WS makes it possible to export and import the public aspects embodied in business protocols as process or role templates while maintaining the intent and structure of the protocols. This is arguably the most attractive prospect for the use of BPEL4WS from the viewpoint of unlocking the potential of Web Services because it allows the development of tools and other technologies that greatly increase the level of automation and thereby lower the cost in establishing cross-enterprise automated business processes.In summary, we believe that the two usage patterns of business protocol description and executable business process description require a common core of process description concepts. in this specification we Clearly Separate The Core Concepts from the ExtENS Ions Required Specification IS. The Bpel4ws Specification IS Focused On Defining The Common Core, And Adds Only The Essential Extensions Required for Each Usage Pattern.

BPEL4WS defines a model and a grammar for describing the behavior of a business process based on interactions between the process and its partners. The interaction with each partner occurs through Web Service interfaces, and the structure of the relationship at the interface level is encapsulated in what we call a partner link. The BPEL4WS process defines how multiple service interactions with these partners are coordinated to achieve a business goal, as well as the state and the logic necessary for this coordination. BPEL4WS also introduces systematic mechanisms for dealing with business exceptions and processing . faults Finally, BPEL4WS introduces a mechanism to define how individual or composite activities within a process are to be compensated in cases where exceptions occur or a partner requests reversal.BPEL4WS is layered on top of several XML specifications: WSDL 1.1, XML Schema 1.0, And xpath1.0. WSDL Messages and XML Schema Type Definitions Provide The Data Model Used by BPEL4 WS processes. XPath provides support for data manipulation. All external resources and partners are represented as WSDL services. BPEL4WS provides extensibility to accommodate future versions of these standards, specifically the XPath and related standards used in XML computation.

2. Notational Conventions

THE Keywords "Must", "Must Not", "Required", "SHALL", "SHALL NOT", "Shove", "Recommended", "May", and "Optional" in this document area Be Interpreted As Described in RFC2119 [Keywords].

Namespace Uris of The General Form "Some-Uri" Represent Some Application-Dependent OR Context-Dependent Uri As Defined In RFC 2396 [URI].

This specification uses an informal syntax to describe the XML grammar of the XML fragments that follow: The syntax appears as an XML instance, but the values ​​indicate the data types instead of values ​​Grammar in bold has not been introduced earlier in the document, or. IS OF PARTICULAR INTEREST IN AN EXAMPLE. <- Description -> Is A PlaceHolder for Elements from Some "Other" Namespace (Like ## Other In XSD). Characters Are Appended to Elements, Attributes, And as Follows: "?" (0 OR 1), "*" (0 or more), " " (1 or more) ["and"] "" Are used to indeicate That Contaped items area to be treated as a group with respect to THE "?", "*", or " " one "" and group "" "and group" "" Are Meant to be syntactic alternative. The xml namespace prefixes (defined Below) Are Used To indicate the namespace of the element being defined. EXAMPLES Starting with

XSD Schemas and WSDL Definitions Are Provided As A Formal Definition of Grammars [XML Schema 1] [WSDL].

3. RELATIONSHIP WITH WSDL

BPEL4WS Depends on The Following XML-based Specifications: WSDL 1.1, XML Schema 1.0, XPath 1.0 and WS-Addressing.

Among these, WSDL has the most influence on the BPEL4WS language. The BPEL4WS process model is layered on top of the service model defined by WSDL 1.1. At the core of the BPEL4WS process model is the notion of peer-to-peer interaction between services described in WSDL; both the process and its partners are modeled as WSDL services A business process defines how to coordinate the interactions between a process instance and its partners in this sense, a BPEL4WS process definition provides and / or uses one or more WSDL.. services, and provides the description of the behavior and interactions of a process instance relative to its partners and resources through Web Service interfaces. That is, BPEL4WS defines the message exchange protocols followed by the business process of a specific role in the interaction.The definition Of a BPEL4WS Business Process Also Follows The WSDL Model of Secs Between The Abstract Message Contents Used by The Business Process And Deployment Information (ME . Ssages and portType versus binding and address information) In particular, a BPEL4WS process represents all partners and interactions with these partners in terms of abstract WSDL interfaces (portTypes and operations); no references are made to the actual services used by a process instance.

However, the abstract part of WSDL does not define the constraints imposed on the communication patterns supported by the concrete bindings. Therefore a BPEL4WS process may define behavior relative to a partner service that is not supported by all possible bindings, and it may happen that some Bindings Are Invalid for a Bpel4ws Process Definition.

A BPEL4WS process is a reusable definition that can be deployed in different ways and in different scenarios, while maintaining a uniform application-level behavior across all of them. Note that the description of the deployment of a BPEL4WS process is out of scope for this specification .The dependency on [WS-Addressing] is meant to avoid inventing a private BPEL4WS mechanism for web service endpoint references-such references are obviously a very general requirement in the usage of web services.

4. What change from BPEL4WS 1.0

The BPEL4WS 1.1 specification is an enhancement of the BPEL4WS 1.0 specification [BPEL]. The 1.1 version has five new authors who brought a fresh viewpoint and deep industry experience. Their contributions are reflected in a number of enhancements in this version.

THE 1.1 Version Incorates Numerous Corrections and Clarifications Based on The Feedback Received on The 1.0 Version. In Addued, The 1.1 Version Differs from The 1.0 Version in The Following Substantive Ways.

4.1. Core Concepts Clarification

We believe that the two usage patterns of business protocol description and executable business process description require a common core of process description concepts. In the 1.1 version of the specification we clearly separate the core concepts from the extensions required specifically for the two usage patterns. The main body of the specification defines the core concepts. The 14. Extensions for Executable Processes and the 15. Extensions for Business Protocols are defined in separate sections at the end of the specification. The separation of core concepts from extensions allows features required for specific usage Patterns to be defined in a Composable Manner. It is conceable That Further Extensions Will Be Developed over time as the usage of the specification matures.4.2. Terminology Changes

The Following Terminology Changes Have Occurred

Service Links Are Now Called Partner Links Service Link Types Are Now Called Partner Link Types Service References Are Now Called Endpoint References Containers Are Now Called Variables

The formal syntax has also been changed to reflect these terminology changes, including the replacement of the current partner element with a partnerLink element to reflect the fact that such a link is a conversational interface rather than reflective of a business relationship. A partner element reflective of A Business Relationship Is Added As Described in The next section.

4.3. Feature Changes

The Following Changes Have Been Made

The terminate activity is now strictly limited to executable processes. Partner Link Type Roles are now limited to a single WSDL portType. A new partner element is added to allow grouping of Partner Links based on expected business enterprise relationships. Endpoint references (formerly service references) are now defined as given in [WS-Addressing]. Message Properties are now limited to only be simple types. Web service interactions in abstract processes are now permitted to omit references to variables for inbound and outbound message data. Opaque assignment in abstract processes may now target Boolean variables, and variables of simple but unbounded types. In the latter case the semantics requires creation of a unique value similar to a GUID. The syntax for defining variables has been changed to use three mutually exclusive attributes messagetype, type and element. THE FIRST POINTS TO A WSDL Message Type Definition. The Second Points To An Xml Schema Simple Type. The Third Po ints to an XML Schema global element definition. This allows one to define variables using something other than WSDL message types. Only variables that are defined using messagetypes can be used as input or output targets in messaging operations. The ability to provide an in-line .

Correlation sets have now been added to the uniqueness requirement so that it is not legal to have two web service interactions outstanding if they have the same partner, port type, operation and correlation set (s). In case of activity termination, the activities wait , reply andinvoke are added to receive as being instantly terminated rather than being allowed to finish. The variable provided as the value of the faultVariable attribute in a catch handler to hold fault data is now scoped to the fault handler itself rather than being inherited from the associated scope. Variables and correlation sets can now be associated with local scopes rather than with the process as a whole. This permits easier management of visibility and lifetime for variables and repeated initiation of local correlation sets to allow multiple correlated conversations during, eg, iterative Behavior. Event Handlers Can Now Be Associated with Scopes, To Permit a Process OR Scope To Be Prepared To Receive Exter nal events and requests concurrently with the main activity of the process or scope. This is especially helpful for events and requests that can not be "scheduled" relative to the main activity, but may occur at unpredictable times. The Future Directions section has been dropped since This Version Forms The Starting Point for A Formal Standards Process, Which Will Define Those Directions.5. Core Concepts and Usage Patterns

As noted in the introduction, we believe that the two usage patterns of business protocol description and executable business process description require a common core of process description concepts. In this specification we clearly separate the core concepts from the extensions required specifically for the two usage patterns . The BPEL4WS specification is focused on defining the common core, and adds only the essential extensions required for each usage pattern. These extensions are described in separate sections (14. Extensions for Executable Processes and 15. Extensions for Business Protocols) .In a number of cases, the behavior of a process in a certain combination of circumstances is undefined, eg, when a variable is used before being initialized. in the definition of the core concepts we simply note that the semantics in such cases is not defined.

BPEL4WS takes it as a general principle that compliant implementations MAY choose to perform static analysis to detect and reject process definitions that may have undefined semantics. Such analysis is necessarily pessimistic and therefore might in some cases prevent the use of processes that would not, in fact Create Situations with undefined semantics, either in specific.com or in any.

In the executable usage pattern for BPEL4WS, situations of undefined semantics always result in standard faults in the BPEL4WS namespace. These cases will be described as part of the 14. Extensions for Executable Processes in the specification. However, it is important to note that BPEL4WS uses two standard internal faults for its core control semantics, namely, bpws: forcedTermination and bpws:. joinFailure These are the only two standard faults that play a role in the core concepts of BPEL4WS of course, the occurrence of faults specified in WSDL portType. Definitions During Web Service Invocation is Accounted for In The Core Concepts as well. DEFINING A Business Process

6.1. Initial Example

Before describing the structure of business processes in detail, this section presents a simple example of a BPEL4WS process for handling a purchase order. The aim is to introduce the most basic structures and some of the fundamental concepts of the language.

The operation of the process is very simple, and is represented in the following figure. Dotted lines represent sequencing. Free grouping of sequences represents concurrent sequences. Solid arrows represent control links used for synchronization across concurrent activities. Note that this is not meant to be A Definitive Graphical Notation for Bpel4ws Processes. It is buy here inforally as an aid to understanding.

On receiving the purchase order from a customer, the process initiates three tasks concurrently: calculating the final price for the order, selecting a shipper, and scheduling the production and shipment for the order While some of the processing can proceed concurrently, there are control. and data dependencies between the three tasks. In particular, the shipping price is required to finalize the price calculation, and the shipping date is required for the complete fulfillment schedule. When the three tasks are completed, invoice processing can proceed and the invoice is sent . to the customer.The WSDL portType offered by the service to its customers (purchaseOrderPT) is shown in the following WSDL document Other WSDL definitions required by the business process are included in the same WSDL document for simplicity; in particular, the portTypes for the Web Services Providing Price Calculation, Shipping Selection and Scheduling, and Production Scheduling Functions Are Also Defined There . Observe that there are no bindings or service elements in the WSDL document. A BPEL4WS process is defined "in the abstract" by referencing only the portTypes of the services involved in the process, and not their possible deployments. Defining business processes in this way Allows The Reuse of Business Process Definitions over Multiple Deployments of Compatible Services.

The partner link types included at the bottom of the WSDL document represent the interaction between the purchase order service and each of the parties with which it interacts (see [partnerlinktypespartnerlinksandendpointreferences]). Partner link types can be used to represent dependencies between services, regardless of whether a BPEL4WS business process is defined for one or more of those services. each partner link type defines up to two "role" names, and lists the portTypes that each role must support for the interaction to be carried out successfully. In this example, two partner link types, "purchasingLT" and "schedulingLT", list a single role because, in the corresponding service interactions, one of the parties provides all the invoked operations: The "purchasingLT" partner link represents the connection between the process and the requesting Customer, WHERE ONLY TO OFFERS A Service Operation ("SendpurchaseOrder"); The "Schedulinglt" Partner Li nk represents the interaction between the purchase order service and the scheduling service, in which only operations of the latter are invoked. The two other partner link types, "invoicingLT" and "shippingLT", define two roles because both the user of the invoice calculation and the user of the shipping service (the invoice or the shipping schedule) must provide callback operations to enable asynchronous notifications to be asynchronously sent ( "invoiceCallbackPT" and "shippingCallbackPT" portTypes).

XMLns: SNS = "http://manufacturing.org/xsd/purchase"

XMLns: POS = "http://manufacturing.org/wsdl/purchase" xmlns: xsd = "http://www.w3.org/2001/xmlschema"

XMLns = "http://schemas.xmlsoap.org/wsdl/"

XMLns: PLNK = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/">

Location = "http://manufacturing.org/xsd/purchase.xsd" />

Message = "POS: OrderFaultType" />

Message = "POS: OrderFaultType" />

The business process for the order service is defined next. There Are Four Major Sections in this process definition:

The section defines the data variables used by the process, providing their definitions in terms of WSDL message types, XML Schema simple types, or XML Schema elements. Variables allow processes to maintain state data and process history based on messages exchanged. The section defines the different parties that interact with the business process in the course of processing the order. The four partnerLinks shown here correspond to the sender of the order (customer), as well as the providers of price (invoicingProvider), shipment (shippingProvider), and manufacturing scheduling services (schedulingProvider). Each partner link is characterized by a partner link type and a role name. This information identifies the functionality that must be provided by the business process and by the partner service for the relationship to succeed , That IS, The Porttypes That The Purchase Order Process And The Partner Need To Implement. The

section contains fault handlers defining the activities that must be performed in response to faults resulting from the invocation of the assessment and approval services. In BPEL4WS, all faults, whether internal or resulting from a service invocation, are identified by a qualified name. In particular , each WSDL fault is identified in BPEL4WS by a qualified name formed by the target namespace of the WSDL document in which the relevant portType and fault are defined, and the ncname of the fault. It is important to note, however, that because WSDL 1.1 does not require that fault names be unique within the namespace where the operation is defined, all faults sharing a common name and defined in the same namespace are indistinguishable. in spite of this serious WSDL limitation, BPEL4WS provides a uniform naming model for faults, in THE EXPECTATION THAT FUTURE VERSIONS OF WSDL WILL PROVIDE A BETER FAULT-NAMING MODEL. The Rest of the Process Definition Contains The Description of the Norma L BEHAVIOR for Handling a Purchase Request. The Major Elements of this Description Are Explained in The section Following The Process Definition.

Targetnamespace = "http://acme.com/ws-bp/purchase"

Xmlns = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns: lns = "http://manufacturing.org/wsdl/purchase">

PartnerLinkType = "lns: purchaasinglt"

Myrole = "purchaaseservice" />

PartnerLinkType = "lns: invoicinglt"

Myrole = "InvoiceRequester"

Partnerrole = "InvoiceService" />

Myrole = "ShippingRequester"

Partnerrole = "ShippingService" />

PartnerLinkType = "lns: schedulinglt"

Partnerrole = "SchedulingService" />

MessageType = "lns: invmessage" />

MessageType = "lns: orderfaulttype" />

MessageType = "LNS: ShippingRequestMessage" />

MessageType = "lns: shippingInfomessage" />

MessageType = "lns: scheduleMessage" />

Faultvariable = "Pofault">

PortType = "lns: purchaseorderpt"

Operation = "SendpurchaseOrder"

Variable = "Pofault"

Faultname = "cannotcompleteRder" />

PortType = "lns: purchaseorderpt"

Operation = "SendpurchaseOrder"

Variable = "Po">

Part = "Customerinfo" />

Porttype = "lns: shippingpt"

Operation = "RequestshipPing"

InputVariable = "shippingRequest"

Outputvariable = "shippingInfo">

PortType = "lns: shippingcallbackpt"

Operation = "sendschedule"

Variable = "ShippingSchedule">

PortType = "lns: computepricept"

Operation = "initiatepricecalculation"

InputVariable = "Po">

PortType = "lns: computepricept"

Operation = "SendshipPingprice"

InputVariable = "ShippingInfo">

PortType = "lns: invoicecallbackpt"

Operation = "SendInvoice"

Variable = "invoice" />

PortType = "lns: schedulingpt"

Operation = "RequestProductionsCheduling"

InputVariable = "Po">

PortType = "lns: schedulingpt"

Operation = "SendshipPingschedule" InputVariable = "ShippingSchedule">

PortType = "lns: purchaseorderpt"

Operation = "SendpurchaseOrder"

Variable = "invoice" />

The structure of the main processing section is defined by the outer element, which states that the three activities contained inside are performed in order. The customer request is received ( element), then processed (inside a section that enables concurrent behavior), and a reply message with the final approval status of the request is sent back to the customer (). Note that the and elements are matched respectively to the and messages of the "sendPurchaseOrder" operation invoked by the customer, while the activities performed by the process between these elements represent the actions taken in response to the customer request, from the time the request is received to the time the response is Sent Back (reply).

The example makes the implicit assumption that the customer request can be processed in a reasonable amount of time, justifying the requirement that the invoker wait for a synchronous response (because this service is offered as a request-response operation). When that assumption does not hold, the interaction with the customer is better modeled as a pair of asynchronous message exchanges. In that case, the "sendPurchaseOrder" operation is a one-way operation and the asynchronous response is sent by invoking a second one-way operation on a customer "callback" interface. in addition to changing the signature of "sendPurchaseOrder" and defining a new portType to represent the customer callback interface, two modifications need to be made in the preceding example to support an asynchronous response to the customer. First, the partner Link Type "Purchasinglt" That Repesents The Process-Customer Connection Needs to include A Second Role ("Customer") Listing The Customer Callback PortType. Second, The Activity in the process Needs to be replaced by an on the customer callback operation.

The processing taking place inside the element consists of three blocks running concurrently. The synchronization dependencies between activities in the three concurrent sequences are expressed by using "links" to connect them. The links are defined inside the flow and are used to connect a source activity to a target activity. (Note that each activity declares itself as the source or target of a link by using the nested and elements.) In the absence of links, the activities nested directly inside a flow proceed concurrently. In the example, however, the presence of two links introduces control dependencies between the activities performed inside each sequence. For example, while the price calculation can be started immediately after the request is received, shipping price can only be Added to the invoice after the shipper information has been obtained; this dependency is represented by the link (named "ship-to-invoice) That Connects The First Call on the shipping provider ( "requestShipping") with sending shipping information to the price calculation service ( "sendShippingPrice") Likewise, shipping scheduling information can only be sent to the manufacturing scheduling service after it has been received from the shipper service;. thus the NEED for the second link ("ship-to-scheduling").

Observe that information is passed between the different activities in an implicit way through the sharing of globally visible data variables. In this example, the control dependencies represented by links are related to corresponding data dependencies, in one case on the availability of the shipper rates and in another on the availability of a shipping schedule. The information is passed from the activity that generates it to the activity that uses it by means of two global data variables ( "shippingInfo" and "shippingSchedule"). Certain operations can return faults, as defined in their WSDL definitions. For simplicity, it is assumed here that the two operations return the same fault ( "cannotCompleteOrder"). When a fault occurs, normal processing is terminated and control is transferred to the corresponding fault handler, as defined in the Section. in this Example The Handler Uses a Element to return a fault to the customer (Note the "faultname" attribute in the element).

Finally, it is important to observe how an assignment activity is used to transfer information between data variables. The simple assignments shown in this example transfer a message part from a source variable to a message part in a target variable, but more complex forms of assignments Are Also Possible.

6.2. The Structure of a Business Process

THIS Section Provides A Quick Summary of The Bpel4ws Syntax. It provides only a brief overview; The details of each language construct is Dosiss.

The Basic Structure of The Language IS:

QueryLanguage = "Anyuri"?

ExpressionLanguage = "anyuri"?

SuppressJoinFailure = "YES | NO"?

EnableInstanceCompensation = "YES | NO"?

AbstractProcess = "Yes | NO"?

Xmlns = "http://schemas.xmlsoap.org/ws/2003/03/business-process/">

?

Myrole = "ncname"? PartnerRole = "ncname"?>

?

?

TYPE = "QNAME"? Element = "Qname"? />

?

?

*

Activity

?

Activity

?

Activity

?

Operation = "ncname" variable = "ncname"?>

?

Activity

*

Activity

Activity

The Top-Level Attributes Are As Follows:

. QueryLanguage This attribute specifies the XML query language used for selection of nodes in assignment, property definition, and other uses The default for this attribute is XPath 1.0, represented by the URI of the XPath 1.0 specification:. Http: //www.w3 .. .org / TR / 1999 / REC-xpath-19991116 expressionLanguage This attribute specifies the expression language used in the process The default for this attribute is XPath 1.0, represented by the URI of the XPath 1.0 specification:. http: // www .w3.org / TR / 1999 / REC-xpath-19991116. suppressJoinFailure. This attribute determines whether the joinFailure fault will be suppressed for all activities in the process. The effect of the attribute at the process level can be overridden by an activity using a different value for the attribute. The default for this attribute is "no". enableInstanceCompensation. This attribute determines whether the process instance as a whole can be compensated by platform-specific means. The default for this attribute is " No ". AbstractProcess. this attribute specifies WHETER THE PROCESS Being Defined IS Abstract (Rather Than Executable). The Default for this Attribute IS" no ".

The Token "Activity" Can Be Any The Following:

> > >

The syntax of each of these elements, except , is considered in the following paragraphs. Although is permitted as an interpretation of the token activity, it is only available in executable processes and as such is defined in the section on 14. Extensions for Executable Processes.The Construct Allows The Business Process To Do a Blocking Wait for a Matching Message To Arrive.

Variable = "ncname"? CREATEINSTANCE = "YES | NO"?

Standard-attributes>

Standard-Elements

?

The construct allows the business process to send a message in reply to a message that was received through a . The combination of a and a forms a request-response operation on the WSDL portType for .

Variable = "ncname"? FaultName = "QNAME"?

Standard-attributes>

Standard-Elements

?

The Construct Allows The Business Process To Invoke A One-Way Or Request-Response Operation ON A Porttype Officeed by a Partner.

INPUTVARIABLE = "ncname"? Outputvariable = "ncname"?

Standard-Attributes> Standard-Elements

?

Pattern = "in | OUT | OUT-IN" />

*

Activity

?

Activity

?

Activity

The construct can be used to update the value of variables with new data. AN Construct CAN contain any number of elementary assignments. The syntax of the assignment activity is:

Standard-Elements

From-spec

TO-SPEC

The Construct generates a fault from inside the business process.

Standard-Elements

.

Standard-Elements

The Construct Allows you to insert a "No-OP" instruction INTO A Business Process. This is useful for Synchronization of ConcURrent Activities, for instance.

Standard-Elements

.

Standard-ElementsActivity

The Construct Allows you to select Exactly One Branch of Activity from A Set of Choices.

Standard-Elements

Activity

?

Activity

...................... ..

Standard-ElementsActivity

The construct allows you to block and wait for a suitable message to arrive or for a time-out alarm to go off. When one of these triggers occurs, the associated activity is performed and the pick completes.

Standard-Elements

Operation = "ncname" variable = "ncname"?>

?

Activity

*

Activity

The Construct Allows you to specify one or more activities to be be used for the control. Links can define Arbitrary Control Structure.

Standard-Elements

?

Activity

The construct allows you to define a nested activity with its own associated variables, fault handlers, and compensation handler.

Standard-Elements

?

... See Above Under for syntax ...

?

... See Above Under for syntax ...

?

... See Above Under for syntax ...

?

... See Above Under for syntax ...

?

...

Activity

.....S.ji

Standard-Elements

Note That The "Standard-Attributes" Referred To Above Are:

Name = "ncname"?

JOINCONDITION = "BOOL-EXPR"?

SuppressJoinFailure = "YES | NO"?

WHERE The Default Values ​​Are As Follows:

Name. No Default Value (That IS, UNNAMED) JOINCONDITION. The Logical or of the Liveness Status of All Links That Are Targeted At this Activity SuppressJoinFailure. No

And That the "Standard-Elements" Referred to Above Are:

*

*

Where the default value of the "TransitionCondition" Attribute IS "true ()" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

BPEL4WS contains constructs that are generally sufficient for expressing abstract and executable business processes. In some cases, however, it might be necessary to "extend" the BPEL4WS language with additional constructs from other XML namespaces.

BPEL4WS supports extensibility by allowing namespace-qualified attributes to appear on any BPEL4WS element and by allowing elements from other namespaces to appear within BPEL4WS defined elements. This is allowed in the XML Schema specifications for BPEL4WS.

EXTENSIONS MUST NOT CHANGE The Semantics of Any Element OR Attribute from the Bpel4ws Namespace.

6.4. The Lifecycle of a Business Process

As noted in the introduction, the interaction model that is directly supported by WSDL is essentially a stateless client-server model of synchronous or uncorrelated asynchronous interactions. BPEL4WS, builds on WSDL by assuming that all external interactions of the business process occur through Web Service operations . However, BPEL4WS business processes represent stateful long-running interactions in which each interaction has a beginning, defined behavior during its lifetime, and an end. For example, in a supply chain, a seller's business process might offer a service that begins an interaction by accepting a purchase order through an input message, and then returns an acknowledgement to the buyer if the order can be fulfilled. It might later send further messages to the buyer, such as shipping notices and invoices. The seller's business process remembers the state of Each Such Purchase Order Interaction Separately from Other Similar Interactions. this is Necessary Because A Buyer Mi GHT BE Carrying ON Many Simultaneous Purchase Processes With the Same Seller. in Short, a Bpel4ws Business Process Definition Can Be Thought of Asia Template for Creating Business Process Instances.

The creation of a process instance in BPEL4WS is always implicit; activities that receive messages (that is, receive activities and pick activities) can be annotated to indicate that the occurrence of that activity causes a new instance of the business process to be created This. is done by setting the createInstance attribute of such an activity to "yes". When a message is received by such an activity, an instance of the business process is created if it does not already exist (see 11.4. Providing Web Service Operations and 12.4 . Pick) .To be instantiated, each business process must contain at least one such "start activity." This must be an initial activity in the sense that there is no basic activity that logically precedes it in the behavior of the process.

If more than one start activity is enabled concurrently, then all such activities must use at least one correlation set and must use the same correlation sets (see 10. Correlation and the 16.3. Multiple Start Activities example).

If exactly one start activity is expected to instantiate the process, the use of correlation sets is unconstrained This includes a pick with multiple onMessage branches;. Each such branch can use different correlation sets or no correlation sets.

A Business Process Instance Is Terminated in One of The Following Ways:

When the activity that defines the behavior of the process as a whole completes. In this case the termination is normal. When a fault reaches the process scope, and is either handled or not handled. In this case the termination is considered abnormal even if the fault is handled and the fault handler does not rethrow any fault. A compensation handler is never installed for a scope that terminates abnormally. When a process instance is explicitly terminated by a terminate activity (see 14.6. Terminating a Service instance). In this case the termination is abnormal. If a compensation handler is specified for the business process as a whole (see 13.3. Compensation Handlers), a business process instance can be compensated after normal completion by platform-specific means. This functionality is enabled by setting the enableInstanceCompensation Attribute of the process to "yes" .7. partner link types, partner links, and endpoint references

A very important, if not the most important, use case for BPEL4WS will be in describing cross-enterprise business interactions in which the business processes of each enterprise interact through Web Service interfaces with the processes of other enterprises. An important requirement for realistic modeling of business processing in this environment is the ability to model the required relationship with a partner process. WSDL already describes the functionality of a service provided by a partner, at both the abstract and concrete levels. The relationship of a business process to a partner is typically peer-to-peer, requiring a two-way dependency at the service level. In other words, a partner represents both a consumer of a service provided by the business process and a provider of a service to the business process. This is especially the Case When The Interactions Are Based ON ASYNCHRONOS MESSAGING Rather Than Remote Procedure Calls. The notion of partner links is buy to Directly model peer-to-peer conversational partner relationships. Partner links define the shape of a relationship with a partner by defining the message and port types used in the interactions in both directions. However, the actual partner service may be dynamically determined within the process. BPEL4WS Uses a Notion of Endpoint Reference [WS-Addressing] To Repesent The Dynamic Data Required to Describe a Partner Service Endpoint.

It is important to emphasize that the notions of partner link and endpoint reference used here are preliminary. The specification for these concepts as they relate to Web Services is still evolving, and we expect normative definitions for them to emerge in future. The BPEL4WS specification will Be updated to conform to the expected future standards.7.1. Partner link types

A partner link type characterizes the conversational relationship between two services by defining the "roles" played by each of the services in the conversation and specifying the portType provided by each service to receive messages within the context of the conversation. The following example illustrates the basic SYNTAX OF A Partner Link Type Declaration:

XMLns = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/">

Each Role Specifies Exactly One WSDL Porttype.

In the common case, portTypes of the two roles originate from separate namespaces. However, in some cases, both roles of a partner link type can be defined in terms of portTypes from the same namespace. The latter situation occurs for partner link types that define "Callback" RELATIONS BETWEEN SERVICES.

The partner link type definition can be a separate artifact independent of either service's WSDL document. Alternatively, the partner link type definition can be placed within the WSDL document defining the portTypes from which the different roles are defined.The extensibility mechanism of WSDL 1.1 is used to define partnerLinkType as a new definition type to be placed as an immediate child element of a element in all cases This allows reuse of the WSDL target namespace specification and, more importantly, its import mechanism to import portTypes For.. Cases WHERE A PartnerLinkType Declaration is Linking The Porttypes of Two Different Services, The PartnerLinkType Declaration Can Be Placed In A Separate WSDL Document (with Its Own TargetNameSpace).

The Syntax for Defining a PartnerLinkType IS:

XMLns = "http://schemas.xmlsoap.org/wsdl/"

XMLns: PLNK = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/">

...

?

...

This defines a partner link type in the namespace indicated by the value of the "targetNamespace" attribute of the WSDL document element. The portTypes identified within roles are referenced by using QNames as for all top-level WSDL definitions.

Note that in some cases it can be meaningful to define a partner link type containing exactly one role instead of two. That defines a partner linking scenario where one service expresses a willingness to link with any other service, without placing any requirements on the other service .Examples of partnerlinkType Declarations Are Found In Various Business Process Examples in this specification.

7.2. Partner Links

The services with which a business process interacts are modeled as partner links in BPEL4WS. Each partner link is characterized by a partnerLinkType. More than one partner link can be characterized by the same partnerLinkType. For example, a certain procurement process might use more than one Vendor for ITS Transactions, But Might Use The Same PartnerLinkType for All Vendors.

Myrole = "ncname"? PartnerRole = "ncname"?>

Each partnerLink is named, and this name is used for all service interactions via that partnerLink. This is critical, for example, in correlating responses to different partnerLinks for simultaneous requests of the same kind (see 11.3. Invoking Web Service Operations and 11.4. Providing Web Service Operations.

The role of the business process itself is indicated by the attribute myRole and the role of the partner is indicated by the attribute partnerRole. In the degenerate case where a partnerLinkType has only one role, one of these attributes is omitted as appropriate.

Note that the partnerLink declarations specify the static shape of the relationships that the BPEL4WS process will employ in its behavior. Before operations on a partner's service can be invoked via a partnerLink, the binding and communication data for the partner service must be available. The relevant information about a partner service can be set as part of business process deployment. This is outside the scope of BPEL4WS. However, it is also possible to select and assign actual partner services dynamically, and BPEL4WS provides the mechanisms to so via do assignment of endpoint references. in fact, because the partners are likely to be stateful, the service endpoint information needs to be extended with instance-specific information. BPEL4WS allows the endpoint references implicitly present in partnerLinks to be both extracted and assigned dynamically, and also to be set More Than Once. See 9.3. Assignment for the mechanisms buy for Dynamic Assignment of Endpoint References To Par Tner Services.7.3. Business Partners

While a partner link represents a conversational relationship between two partner processes, relationships with a business partner in general require more than a single conversational relationship to be established. To represent the capabilities required from a business partner, BPEL4WS uses the partner element. A partner is Defined as a subsset of the partner links of the process, as shown in the example bell.

XMLns = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/">

Partner definitions are optional and need not cover all the partner links defined in the process. From the process perspective a partner definition introduces a constraint on the functionality that a business partner is required to provide. In the example above, the partner definition states that the same business partner ( "SellerShipper") is required to provide the services associated with the the roles of seller and shipper. Partner definitions MUST NOT overlap, that is, a partner link MUST NOT appear in more than one partner definition.The syntax for partner Definitions is Given Below:

7.4. Endpoint References

WSDL makes an important distinction between portTypes and ports. PortTypes define abstract functionality by using abstract messages. Ports provide actual access information, including communication endpoints and (by using extension elements) other deployment-related information such as public keys for encryption. Bindings provide the glue between the two. While the user of a service must be statically dependent on the abstract interface defined by portTypes, some of the information contained in port definitions can typically be discovered and used dynamically.

The fundamental use of endpoint references is to serve as the mechanism for dynamic communication of port-specific data for services. An endpoint reference makes it possible in BPEL4WS to dynamically select a provider for a particular type of service and to invoke their operations. BPEL4WS provides a general mechanism for correlating messages to stateful instances of a service, and therefore endpoint references that carry instance-neutral port information are often sufficient. However, in general it is necessary to carry additional instance-identification tokens in the endpoint reference itself.BPEL4WS uses the notion of endpoint reference defined in [WS-Addressing]. Every partner role in a partnerLink in a BPEL4WS process instance is assigned a unique endpoint reference in the course of the deployment of the process or dynamically by an activity within the process.

8. Message Properties

8.1. Motivation

The data in a message consists conceptually of two parts:. Application data and protocol-relevant data, where the protocols can be business protocols or infrastructure protocols providing higher quality of service An example of business protocol data is the correlation tokens that are used in correlation sets (see 10. Correlation). Examples of infrastructure protocols are security, transaction, and reliable messaging protocols. The business protocol data is usually found embedded in the application-visible message parts, whereas the infrastructure protocols almost always add implicit extra parts to the message types to represent protocol headers that are separate from application data. Such implicit parts are often called message context because they relate to security context, transaction context, and other similar middleware context of the interaction. Business processes might need to gain access to and manipulate Both Kinds of Protocol-Relevant Data. The Notion of Message Properties is defined as a general way of naming and representing distinguished data elements within a message, whether in application-visible data or in message context. For a full accounting of the service description aspects of infrastructure protocols, it is necessary to define notions of service policies , endpoint properties, and message context. This work is outside the scope of BPEL4WS. Message properties are defined here in a sufficiently general way to cover message context consisting of implicit parts, but the use in this specification focuses on properties embedded in application-visible Data That Is Used In The Definition of Business Protocols and Abstract Business Processes.8.2. Defining Properties

A property definition creates a globally unique name and associates it with an XML Schema simple type. The intent is not to create a new type. The intent is to create a name that has greater significance than the type itself. For example, a sequence number can be an integer, but the integer type does not convey this significance, whereas a globally named sequence-number property does. Properties can occur anywhere in a message, including in the message context.A typical use for a property in BPEL4WS is to name a token for correlation of service instances with messages. for example, a social security number might be used to identify an individual taxpayer in a long-running multiparty business process regarding a tax matter. A social security number can appear in many different message types, BUTIN THE CONTEXT OF A TAX-Related Process It Has A Specific Significance As a TaxPayer ID. Therefore A Global Name Is Given to this use of the type by Defining a Property, AS in The Following Exam PLE:

Targetnamespace = "http://example.com/properties.wsdl"

XMLns: TNS = "http://example.com/properties.wsdl"

XMLns: txtyp = "http://example.com/taxtypes.xsd"

XMLns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns = "http://schemas.xmlsoap.org/wsdl/">

TYPE = "txtyp: ssn" />

...

In correlation, the property name must have global significance to be of any use. Properties such as price, risk, response latency, and so on, which are used in conditional behavior in a business process, have similar global and public significance. It is likely that they will be mapped to multiple messages, and therefore they need to be globally named as in the case of correlation properties. Such properties are essential, especially in abstract processes.The WSDL extensibility mechanism is used to define properties so that the target namespace and other useful aspects of WSDL are available. The BPEL4WS standard namespace, "http://schemas.xmlsoap.org/ws/2003/03/business-process/", is used for property definitions. The syntax for a property definition is A New Kind of WSDL Definition As Follows:

Xmlns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/">

...

Properties used in business protocols are typically embedded in application-visible message data. The notion of aliasing is introduced to map a global property to a field in a specific message part. The property name becomes an alias for the message part and location, and can BE Used as Such in 9.1. Expressions and 9.3. Assignment In Abstract Business Processes.

Targetnamespace = "http://example.com/properties.wsdl"

XMLns: TNS = "http://example.com/properties.wsdl"

XMLns: txtyp = "http://example.com/taxtypes.xsd"

XMLns: TXMSG = "http://example.com/taxmessages.wsdl"

XMLns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/" XMLns = "http://schemas.xmlsoap.org/wsdl/">

...

MessageType = "TXMSG: TaxPayerInfo" part = "identification"

Query = "/ Socialsecnumber" />

THE BPWS: Propertyalias Defines A Globally Named Property Tns: TaxPayernumber as an alias for a location in the identification part of the message type txmsg: TaxPayerInfo.

The Syntax for a Propertyalias Definition IS:

...

Xmlns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/">

MessageType = "qname" part = "ncname" query = "querystring" />

...

The Interpretation of the Message, Part, And Query Attributes Is The Same AS in The Corresponding from-Spec in Copy Assignments (see 9.3. Assignment).

9. Data Handling

Business processes model stateful interactions. The state involved consists of messages received and sent as well as other relevant data such as time-out values. The maintenance of the state of a business process requires the use of state variables, which are called variables in BPEL4WS . Furthermore, the data from the state needs to be extracted and combined in interesting ways to control the behavior of the process, which requires data expressions. Finally, state update requires a notion of assignment. BPEL4WS provides these features for XML data types and WSDL message types. The XML family of standards in these areas is still evolving, and using the process-level attributes for query and expression languages ​​provides for the incorporation of future standards.The extensions required for abstract and executable processes are concentrated in the data-handling Feature set. EXECUTABLE Processes Are Permitted to Use The Full Power of Data Selection and Assignment But Are Not Permitted To U se nondeterministic values. Abstract processes are restricted to limited manipulation of values ​​contained in message properties but are permitted to use nondeterministic values ​​to reflect the consequences of hidden private behavior. Detailed differences are specified in the following sections.

9.1. Expressions

BPEL4WS Uses Several Types of Expressions. The Kinds of Expressions Used Area Follows (Relevant Usage Contexts Are listed in parentheses):

Boolean-valued expressions (transition conditions, join conditions, while condition, and switch cases) Deadline-valued expressions ( "until" attribute of onAlarm and wait) Duration-valued expressions ( "for" attribute of onAlarm and wait) General expressions (assignment )

BPEL4WS provides an extensible mechanism for the language used in these expressions. The language is specified by the expressionLanguage attribute of the process element. Compliant implementations of the current version of BPEL4WS MUST support the use of XPath 1.0 as the expression language. XPath 1.0 is indicated By The Default Value of The ExpressionLanguage Attribute, Which IS: http://www.w3.org/tr/1999/rec-xpath-19991116

Given an expression language, it must be possible to query data from variables, to extract property values, and to query the status of links from within expressions. This specification defines those functions for XPath 1.0 only, and it is expected that other expression-language Bindings Will Provide Equivalent FunctionAlity. The rest of this section................

BPEL4WS introduces several extension functions to XPath's built-in functions to enable XPath 1.0 expressions to access information from the process. The extensions are defined in the standard BPEL4WS namespace "http://schemas.xmlsoap.org/ws/2003/03/business -process / ". The prefix" bpws: "is associated with this name.

Any Qualified Names Used With Using Namespace Declarations Currently In Scope in the Bpel4ws Document At The location of the expression.

The Following Functions Are Defined by this Specification:

BPWS: GetVariableProperty ('Variablename', 'PropertyName')

This function extracts global property values ​​from variables. The first argument names the source variable for the data and the second is the qualified name (QName) of the global property to select from that variable (see 8. Message Properties). If the given property does not appear in any of the parts of the variable's message type, then the semantics of the process is undefined. The return value of this function is a node set containing the single node representing the property. If the given property definition selects a node set Of a size other than one, the the semantics of the process is undefined.bpws: getLinkStatus ('linkname ")

This function returns a Boolean indicating the status of the link (see 12.5.1. Link Semantics). If the status of the link is positive the value is true, and if the status is negative the value is false. This function MUST NOT be Used Anywhere Except in a Join Condition. The LinkName Argument Must Refer to the name of an incoming link for the activity associated with the Join Condition. The constricts must be staticly enforces.

This BPEL4WS-Defined Extension Functions Are Available for Use With IL xi XPath 1.0 Expressions.

The Syntax of XPath 1.0 Expressions for Bpel4ws is considered in The Following Paragraphs.

9.1.1. Boolean Expressions

...........................

9.1.2. Deadline-Valued Expressions

These are expressions that conform to the XPath 1.0 Expr production where the evaluation results in values ​​that are of the XML Schema types dateTime or date. Note that XPath 1.0 is not XML Schema aware. As such, none of the built-in functions of XPath 1.0 are capable of producing or manipulating dateTime or date values. However, it is possible to write a constant (literal) that conforms to XML Schema definitions and use that as a deadline value or to extract a field from a variable (part) of one of these types and use that as a deadline value. XPath 1.0 will treat that literal as a string literal, but the result can be interpreted as a lexical representation of a dateTime or date value.9.1.3. Duration-Valued Expressions

These are expressions that conform to the XPath 1.0 Expr production where the evaluation results in values ​​that are of the XML Schema type duration. The preceding discussion about XPath 1.0's XML Schema unawareness applies here as well.

9.1.4. General Expressions

The XPATH 1.0 Expr Production Where The evults in Any XPath Value Type (String, Number, OR Boolean).

Expressions with Operators Are Restricted As Follows:

All numeric values ​​including arbitrary constants are permitted with the equality or relational operators (<, <=, =,! =,> =,>). Values ​​of integral (short, int, long, unsignedShort, and so on) type including constants are permitted in numeric expressions, provided that only integer arithmetic is performed. in practice, this means that division is disallowed. It is difficult to enforce this restriction in XPath 1.0 because XPath 1.0 lacks integral support for types. The restriction should be taken as a statement of intent that will be enforced in the future when expression languages ​​with more refined type systems become available. Only equality operators (=,! =) are permitted when used with values ​​of string type including constants.These restrictions reflect XPath 1.0 syntax and semantics .......................................................................................................... expressions are meant to be used to perform business protocol-related computation such as retry loops, line-item counts, and so on, that must be transparent in the process definition. They are not meant to provide arbitrary computation. This is the motivation for .

9.2. Variables

Business processes specify stateful interactions involving the exchange of messages between partners. The state of a business process includes the messages that are exchanged as well as intermediate data used in business logic and in composing messages sent to partners.

Variables provide the means for holding messages that constitute the state of a business process. The messages held are often those that have been received from partners or are to be sent to partners. Variables can also hold data that are needed for holding state related to the Process and never exchanged with partners.the Type of Each Variable May Be a WSDL Message Type or An Xml Schema Element. The Syntax of The Variables Declaration IS:

TYPE = "QNAME"? Element = "Qname"? />

The name of a variable should be unique within its own scope. If a local variable has the same name and same messageType / type / element as a variable defined in an enclosing scope, the local variable will be used in local assignments and / or getVariableProperty Functions. it is not permitted to have all the names. The behavior of such variables is not defined.

The messageType, type or element attributes are used to specify the type of a variable. Exactly one of these attributes must be used. Attribute messageType refers to a WSDL message type definition. Attribute type refers to an XML Schema simple type. Attribute element refers to An XML Schema Element. An XML Schema Complex Type Must Be Associated with an element to be used by a bpel4ws variable.

An Example of a Variable Declaration Using A Message Type Decland In a Wsdl Document with The TargetNamespace "http://example.com/orders":

name = "orderDetails" messageType = "ORD: orderDetails" /> Variables associated with message types can be specified as input or output variables for invoke, receive, and reply activities (see 11.3 Invoking Web Service Operations and 11.4 Providing Web Service Operations.. ). When an invoke operation returns a fault message, this causes a fault in the current scope. The fault variable in the corresponding fault handler is initialized with the fault message received (see 13. Scopes and 13.4. Fault Handlers).

Each variable is declared within a scope and is said to belong to that scope. Variables that belong to the global process scope are called global variables. Variables may also belong to other, non-global scopes, and such variables are called local variables. Each variable is visible only in the scope in which it is defined and in all scopes nested within the scope it belongs to. Thus, global variables are visible throughout the process. It is possible to "hide" a variable in an outer scope by declaring a Variable with an identical name in an inner scope. these Rules Are Exactly Analog to Those In Programming Languages ​​with Lexical Scoping of Variables.

A global variable is in an uninitialized state at the beginning of a process. A local variable is in an uninitialized state at the start of the scope it belongs to. Note that non-global scopes in general start and complete their behavior more than once in the lifetime of the process instance they belong to. Variables can be initialized by a variety of means including assignment and receiving a message. Variables can be partially initialized with property assignment or when some but not all parts in the message type of the variable are assigned VALUES.9.3. Assignment

Copying data from one variable to another is a common task within a business process. The assign activity can be used to copy data from one variable to another, as well as to construct and insert new data using expressions. The use of expressions is primarily motivated by the need to perform simple computation (such as incrementing sequence numbers) that is required for describing business protocol behavior. Expressions operate on message selections, properties, and literal constants to produce a new value for a variable property or selection. Finally, this activity Can Also BE Used to Copy Endpoint References To and from Partner Links.

The Assign Activity Contains One or More Elementary Assignments.

Standard-Elements

From-spec

TO-SPEC

The assign activity copies a type-compatible value from the source ( "from-spec") to the destination ( "to-spec"). The from-spec MUST be one of the following forms except for the opaque form available in abstract processes :

... Literal Value ...

The To-Spec Must Be One of The Following Forms:

In the first from-spec and to-spec variants the variable attribute provides the name of a variable. If the type of the variable is a WSDL messge type the optional part attribute MAY be used to provide the name of a part within that variable. ...................

The second from-spec and to-spec variants allow dynamic manipulation of the endpoint references associated with partner links. The value of the partnerLink attribute is the name of a partnerLink declared in the process. In the case of from-specs, the role must also be specified because a process might need to communicate an endpoint reference corresponding to either its own role or the partner's role within the partnerLink. The value "myRole" means that the endpoint reference of the process with respect to that partnerLink is the source, while the value "partnerRole" means that the partner's endpoint reference for the partnerLink is the source. for the to-spec, the assignment is only possible to the partnerRole, hence there is no need to specify the role. The type of the value used in partnerLink-style from / to-specs is always an endpoint reference (see 7. Partner Link Types, Partner Links, and Endpoint References) .The third from-spec and to-spec variants allow explicit manipulation of message properties (see 8. Message Properties) occurring in variables. The property forms are especially useful for abstract processes, because they provide a way to clearly define how distinguished data elements in messages are being used.

The Fourth ("Expression") from-spec Variant Allows Processes To Perform Simple Computations On Properties and Variables (for Example, Increment a Sequence Number).

The fifth from-spec variant allows a literal value to be given as the source value to assign to a destination. The type of the literal value MUST be the type of the destination (to-spec). The type of the literal value MAY be Optionally indeicated inline with the value by using xml schema's instance type mechanism (xsi: type) .9.3.1. Type Compatibility In Assignment

For An Assignment to Be Valid, The Data Referred to by the from and to specifications must be of compatible type. The Following Points make this precise:

The from-spec is a variable of a WSDL message type and the to-spec is a variable of a WSDL message type. In this case both variables MUST be of the same message type, where two message types are said to be equal if their qualified names are the same. The from-spec is a variable of a WSDL message type and the to-spec is not, or vice versa. This is not legal because parts of variables, selections of variable parts, or endpoint references can not be assigned to / from variables of WSDL message types directly. In all other cases, the types of the source and destination are XML Schema types or elements, and the constraint is that the source value MUST possess the element or type associated with the destination. Note that this does not require the types associated with the source and destination to be the same. In particular, the source type MAY be a subtype of the destination type. In the case of variables defined by reference to an element, moreover, both the source and THE TARGET MUST BE T HE Same Element.

THE SEMANTICS OF A Process In Which Any of The Matching Constraints Above Is Violated Is Undefined.

9.3.2. Assignment Example

Theepe Assums The Following Complex Type Definition In The Namespace "http://tempuri.org/bpws/example":

Assume That The Following WSDL Message Definition Exists for the Same Target Namespace:

Also Assume The Following Bpel4ws Variable Declarations:

The Example Illustrates Copying One Variable To Another As Well As Copy A Variable Part To a Variable of Compatible Element Type:

10. Correlation

The information provided so far suggests that the target for messages that are delivered to a business process service is the WSDL port of the recipient service. This is an illusion because, by their very nature, stateful business processes are instantiated to act in accordance with the history of an extended interaction. Therefore, messages sent to such processes need to be delivered not only to the correct destination port, but also to the correct instance of the business process that provides the port. The infrastructure hosting the process must do this in a generic manner, to avoid burdening every process implementation with the need to implement a custom mechanism for instance routing. Messages, which create a new business process instance, are a special case, as described in 6.4. The Lifecycle of a Business Process.

In the object-oriented world, such stateful interactions are mediated by object references, which intrinsically provide the ability to reach a specific object (instance) with the right state and history for the interaction. This works reasonably well in tightly coupled implementations where a dependency on the structure of the implementation is normal. In the loosely coupled world of Web Services, the use of such references would create a fragile web of implementation dependencies that would not survive the independent evolution of business process implementation details at each business partner. In this world, the answer is to rely on the business data and communication protocol headers that define the wire-level contract between partners and to avoid the use of implementation-specific tokens for instance routing whenever possible.

Consider the usual supply-chain situation where a buyer sends a purchase order to a seller. Suppose that the buyer and seller have a stable business relationship and are statically configured to send documents related to the purchasing interaction to the URLs associated with the relevant WSDL service ports. The seller needs to asynchronously return an acknowledgement for the order, and the acknowledgement must be routed to the correct business process instance at the buyer. The obvious and standard mechanism to do this is to carry a business token in the order message (such as a purchase order number) that is copied into the acknowledgement for correlation. The token can be in the message envelope in a header or in the business document (purchase order) itself. in either case, the exact location and type of the token in The Relevant Messages IS Fixed and Instance Independent. Only The Value of The Token ISTANCE Dependent. Theerefore, The Structure and Position of the Correlation Tok ens in each message can be expressed declaratively in the business process description. The BPEL4WS notion of correlation set, described in the following section, provides this feature. The declarative information allows a BPEL4WS-compliant infrastructure to use correlation tokens to provide instance routing automatically.

The declarative specification of correlation relies on declarative properties of messages. A property is simply a "field" within a message identified by a query-by default the query language is XPath 1.0. This is only possible when the type of the message part or binding element is described by using an XML Schema. The use of correlation tokens and endpoint references is restricted to message parts described in this way. to be clear, the actual wire format of such types can still be non-XML, for example, EDI flat Files, Based on Different Bindings for Port Types.10.1. Message Correlation

During its lifetime, a business process instance typically holds one or more conversations with partners involved in its work. Conversations may be based on sophisticated transport infrastructure that correlates the messages involved in a conversation by using some form of conversation identity and routes them automatically to the correct service instance without the need for any annotation within the business process. However, in many cases correlated conversations involve more than two parties or use lightweight transport infrastructure with correlation tokens embedded directly in the application data being exchanged. in such cases, it is often .

Correlation patterns can become quite complex. The use of a particular set of correlation tokens does not, in general, span the entire interaction between a service instance and a partner (instance), but spans a part of the interaction. Correlated exchanges may nest and overlap, and messages may carry several sets of correlation tokens. For example, a buyer might start a correlated exchange with a seller by sending a purchase order (PO) and using a PO number embedded in the PO document as the correlation token. The PO number is used in the PO acknowledgement by the seller. The seller might later send an invoice that carries the PO number, to correlate it with the PO, and also carries an invoice number so that future payment-related messages need to carry only the invoice Number as the correlation token. The Invoice Message thus carrier Two Separate Correlation Tokens and Particles In Two Overlapping Correlated Exchanges.bpel4ws Addresses Correlation Scenarios by Providing a Declarat ive mechanism to specify correlated groups of operations within a service instance. A set of correlation tokens is defined as a set of properties shared by all messages in the correlated group. Such a set of properties is called a correlation set.

Correlation sets are declared within scopes and associated with them in a manner that is analogous to variable declarations. Each correlation set is declared within a scope and is said to belong to that scope. Correlation sets that belong to the global process scope are called global correlation sets. Correlation sets may also belong to other, non-global scopes, and such correlation sets are called local correlation sets. Each correlation set is only visible in the scope in which it is defined and in all scopes nested within the scope it belongs to . Thus, global correlation sets are visible throughout the process. It is possible to "hide" a correlation set in an outer scope by declaring a correlation set with an identical name in an inner scope.A global correlation set is in an uninitiated state at THE BEGINNING OF A Process. a Local Correlation Set Is in An Uninitiated State At The Start of The Scope It Belongs To. Note That Non-Global Scopes in General Start and Complete THEIR BEHAVI OR me.

Correlation sets resemble late-bound constants rather than variables in their semantics. The binding of a correlation set is triggered by a specially marked message send or receive operation. A correlation set can be initiated only once during the lifetime of the scope it belongs to. Thus, a global correlation set can only be initiated at most once during the lifetime of the process instance. Its value, once initiated, can be thought of as an alias for the identity of the business process instance. A local correlation set is available for Binding Each Time The Corresponding Scope Starts, But Once Initiated Must Retain Its Value Until The Scope Completes.

In multiparty business protocols, each participant process in a correlated message exchange acts either as the initiator or as a follower of the exchange. The initiator process sends the first message (as part of an operation invocation) that starts the conversation, and therefore defines the values ​​of the properties in the correlation set that tag the conversation. All other participants are followers that bind their correlation sets in the conversation by receiving an incoming message that provides the values ​​of the properties in the correlation set. Both initiator and followers must mark the First Activity In Their Respective Groups as The Activity That Binds The Correlation SET.10.2. Defining And Using Correlation Sets

The examples in this section show correlation being used on almost every messaging activity (receive, reply, and invoke). This is because BPEL4WS does not assume the use of any sophisticated conversational transport protocols for messaging. In cases where such protocols are used, the EXPLICIT USE OF CORRELATION IN BPEL4WS CAN Be Reduced to Those Activities That Establish The Conversational Connections.

Each correlation set in BPEL4WS is a named group of properties that, taken together, serve to define a way of identifying an application-level conversation within a business protocol instance. A given message can carry multiple correlation sets. After a correlation set is initiated, the values ​​of the properties for a correlation set must be identical for all the messages in all the operations that carry the correlation set and occur within the corresponding scope until its completion. The semantics of a process in which this consistency constraint is violated is undefined. Similarly undefined is the semantics of a process in which an activity with the initiate attribute set to no attempts to use a correlation set that has not been previously initiated.As the following examples illustrate, a correlation set is initiated when the activity within which it is Used Applies The attribute initiate = "yes" to the set.

?

Following is an extended example of correlation It begins by defining four message properties:. CustomerID, orderNumber, vendorID and invoiceNumber All of these properties are defined as part of the "http://example.com/supplyCorrelation.wsdl" namespace defined by. The document.

Targetnamespace = "http://example.com/supplycorrelation.wsdl"

XMLns: TNS = "http://example.com/supplycorrelation.wsdl"

XMLns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns = "http://schemas.xmlsoap.org/wsdl/">

Note that these properties are global names with known (simple) XMLSchema types. They are abstract in the sense that their occurrence in messages needs to be separately specified (see 8. Message Properties). The example continues by defining purchase order and invoice messages and .......................... ...CRIPLILE, Hotel TOE.

Targetnamespace = "http://example.com/supplyMessages.wsdl"

XMLns: TNS = "http://example.com/supplyMessages.wsdl"

XMLns: COR = "http://example.com/supplycorrelation.wsdl"

XMLns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns = "http://schemas.xmlsoap.org/wsdl/">

...

...

...

MessageType = "TNS: potherssage" part = "po"

Query = "/ po / CID" />

MessageType = "TNS: potherssage" part = "po"

Query = "/ po / order" />

MessageType = "TNS: InvMessage" part = "ivc"

Query = "/ ivc / vid" />

MessageType = "TNS: InvMessage" part = "ivc" query = "/ ivc / invnum" />

...

Finally, The PortType Used is defined, in a Separate WSDL Document.

Targetnamespace = "http://example.com/puchaasing.wsdl"

XMLns: SMSG = "http://example.com/supplyMessages.wsdl"

XMLns = "http://schemas.xmlsoap.org/wsdl/">

Both the property and their mapping to purchase Order and Invoice Messages Will B

Used in The Following Correlation Examples.

XMLns: COR = "http://example.com/supplycorrelation.wsdl">

This Set is carried in Application Data ->

This Set is carried in Application Data ->

Properties = "COR: Vendorid Cor: Invoiceenumber" />

Correlation set names are used in invoke, receive, and reply activities (see 11.3. Invoking Web Service Operations and 11.4. Providing Web Service Operations), in the onMessage branches of pick activities, and in the onMessage variant of event handlers (see 12.4. Pick and 13.5.1. Message Events). These sets are used to indicate which correlation sets (ie, the corresponding property sets) occur in the messages being sent and received. The initiate attribute is used to indicate whether the set is being initiated. When the attribute is set to "yes" the set is initiated with the values ​​of the properties occurring in the message being sent or received. Finally, in the case of invoke, when the operation invoked is synchronous request / response, a pattern attribute is used to indicate whether the correlation applies to the outbound (request) message, the inbound (response) message, or both. These ideas are explained in more detail in the context of the use of correlation in the rest of this EXAMPLE.

A message can carry the tokens of one or more correlation sets. The first example shows an interaction in which a purchase order is received in a one-way inbound request and a confirmation including an invoice is sent in the asynchronous response. The PurchaseOrder correlationSet is used in both activities so that the asynchronous response can be correlated to the request at the buyer. The receive activity initiates the PurchaseOrder correlationSet. The buyer is therefore the initiator and the receiving business process is a follower for this correlationSet. The invoke activity sending the asynchronous response also initiates a new correlationSet Invoice. The business process is the initiator of this correlated exchange and the buyer is a follower. The response message is thus a part of two separate conversations, and forms the bridge between them.In the following, the Prefix Sp: represents the namespace "http://example.com/puchaasing.wsdl".

Operation = "asyncpurchase"

Variable = "Po">

Operation = "asyncpurchaseresponse" inputvariable = "Poresponse">

Alternatively, the response might have been a rejection (such as an "out-of-stock" message), which in this case terminates the conversation correlated by the correlationSet PurchaseOrder without starting a new one correlated with Invoice. Note that the initiate attribute is Missing. It therefore has the default value of "no".

Operation = "asyncpurchasereject" InputVariable = "Poreject">

..................... ..

InputVariable = "sendpo"

Outputvariable = "getResponse">

Pattern = "OUT">

Pattern = "in">

Note that an invoke consists of two messages: that initiates it an outgoing request message and an incoming reply message The correlation sets applicable to each message must be separately considered because they can be different In this case the PurchaseOrder correlation applies to the outgoing request.. , while the Invoice correlation applies to the incoming reply and is initiated by the reply. Because the PurchaseOrder correlation is initiated by an outgoing message, the buyer is the initiator of that correlation but a follower of the Invoice correlation because the values ​​of the correlation properties For Invoice Are Initiated by The Seller in The Reply Received by The Buyer.11. Basic Activities

11.1. Standard Attributes for Each Activity

Each activity has optional standard attributes:. A name, a join condition, and an indicator whether a join fault should be suppressed if it occurs A join condition is used to specify requirements about concurrent paths reaching at an activity See 12.5 Flow for a.. Full Discussion of the last two attributes. The default value of suppliesJoinFailure is no.

Name = "ncname"?

JOINCONDITION = "BOOL-EXPR"?

SuppressJoinFail = "YES | NO"?>

The value of the joinCondition attribute is a Boolean-valued expression in the expression language indicated for this document (see 9.1. Expressions). The default value of the join condition for the default expression language XPath is the logical OR of the link status of all Incoming Links of this Activity.

11.2. STANDARD Elements for Each Activity

Each BPEL4WS activity has optional nested standard elements and . The use of these elements is required for establishing synchronization relationships through links (see 12.5. Flow). Each link is defined independently and given a name. The link name is used as value of the linkName attribute of the element. An activity MAY declare itself to be the source of one or more links by including one or more elements. Each element MUST use a distinct link name. Similarly, an activity MAY declare itself to be the target of one or more links by including one or more elements. Each element associated with a given activity MUST use a link name distinct from all other elements at that activity. Each element associated with a given activity MUST use a link name distinct from all other elements at that activity. Each element MAY optionally specify a transition condition that functions as a guard for follo WING THIS specified link. if the transition contract is omitted, it is deemed to be present with the constant value true. *

*

11.3. Invoking Web Service Operations

Web Services provided by partners (see 7. Partner Link Types, Partner Links, and Endpoint References) can be used to perform work in a BPEL4WS business process. Invoking an operation on such a service is a basic activity. Recall that such an operation can be a synchronous request / response or an asynchronous one-way operation. BPEL4WS uses the same basic syntax for both with some additional options for the synchronous case.An asynchronous invocation requires only the input variable of the operation because it does not expect a response as part of the operation (see 11.4. Providing Web Service Operations). A synchronous invocation requires both an input variable and an output variable. One or more correlation sets can be specified to correlate the business process instance with a stateful service at the partner's side ( SEE 10. Correlation). HOWEVER, THESE Attributes Are Both SyntActical Optional Since They Are ABSOLUTELY Required Only in Executable Processes.

In the case of a synchronous invocation, the operation might return a WSDL fault message. This results in a BPEL4WS fault. Such a fault can be caught locally by the activity, and in this case the specified activity will be performed. If a fault is NOT CAUGHT LOCALLY by The Activity It Is Thrown to the Scope That Encloses The Activity (See 13. Scopes and 13.4. Fault Handlers).

Note that a WSDL fault is identified in BPEL4WS by a qualified name formed by the target namespace of the corresponding portType and the fault name. This uniform naming mechanism must be followed even though it does not accurately match WSDL's fault-naming model. Because WSDL does not require that fault names be unique within the namespace where the service operation is defined, all faults sharing a common name and defined in the same namespace are indistinguishable in BPEL4WS. in WSDL 1.1 it is necessary to specify a portType name, an operation name, and the fault name to uniquely identify a fault. This limits the ability to use fault-handling mechanisms to deal with invocation faults. This is an important shortcoming of the WSDL fault model that will be removed in future versions of WSDL.Finally, an activity Can Be Associated with Another Activity That ACTS AS ITS COMPENSATION ACTION. THIS Compensation Handler Can Be Invoked Either Explicitly or by The Default Compensation Handler of The Enclosing Scope (see specref ref = "13scopes" /> and 13.3. Compensation Handlers).

Semantically, the specification of local fault and / or compensation handlers is equivalent to the presence of an implicit scope immediately enclosing the activity and providing those handlers. The name of such an implicit scope is always the same as the name of the activity it encloses.

INPUTVARIABLE = "ncname"? Outputvariable = "ncname"?

Standard-attributes>

Standard-Elements

?

Pattern = "in | OUT | OUT-IN" />

*

Activity

?

Activity

?

Activity

SEE 10. Correlation for An Explanation of The Correlation Semantics. The Following Example Shows An Invocation With a Nested Compensation Handler. Other Examples Are Shown Throughout The Specification.

Operation = "syncpurchase"

InputVariable = "sendpo"

Outputvariable = "getResponse">

Operation = "cancelpurchase"

InputVariable = "getResponse"

Outputvariable = "getconfirmation">

11.4. Providing Web Service Operations

A business process provides services to its partners through receive activities and corresponding reply activities. A receive activity specifies the partner link it expects to receive from, and the port type and operation that it expects the partner to invoke. In addition, it may specify a .

In addition, receive activities play a role in the lifecycle of a business process. The only way to instantiate a business process in BPEL4WS is to annotate a receive activity with the createInstance attribute set to "yes" (see 12.4. Pick for a variant) . The default value of this attribute is "no". A receive activity annotated in this way MUST be an initial activity in the process, that is, the only other basic activities may potentially be performed prior to or simultaneously with such a receive activity MUST be similarly annotated receive activities.It is permissible to have the createInstance attribute set to "yes" for a set of concurrent initial activities. In this case the intent is to express the possibility that any one of a set of required inbound messages can create the process instance because the order in which these messages arrive can not be predicted. All such receive activities MUST use the same correlation sets (see 10. Correlation). Compliant implementations MUST ensure that only one of the inbound messages carrying the same correlation set tokens actually instantiates the business process (usually the first one to arrive, but this is implementation dependent). The other incoming messages in the concurrent initial set MUST be delivered to the corresponding receive activities In the already created instance.

A business process instance MUST NOT simultaneously enable two or more receive activities for the same partnerLink, portType, operation and correlation set (s). Note that receive is a blocking activity in the sense that it will not complete until a matching message is received by the process instance. The semantics of a process in which two or more receive actions for the same partnerLink, portType, operation and correlation set (s) may be simultaneously enabled is undefined. for the purposes of this constraint, an onMessage clause in a pick And An OnMessage Event Handler Are Equivalent To A Receive (See 12.4. Pick and 13.5.1. Message Events).

Variable = "ncname"? CREATEINSTANCE = "YES | NO"?

Standard-attributes>

Standard-Elements

?

A reply activity is used to send a response to a request previously accepted through a receive activity. Such responses are only meaningful for synchronous interactions. An asynchronous response is always sent by invoking the corresponding one-way operation on the partner link. A reply activity May Specify A Variable That Contain The Message Data To Be Sent in Reply. However, this Attribute Is Syntactical Option ONLY IN EXECUTABLE Processes.

The correlation between a request and the corresponding reply is based on the constraint that more than one outstanding synchronous request from a specific partner link for a particular portType, operation and correlation set (s) MUST NOT be outstanding simultaneously. The semantics of a process in which this constraint is violated is undefined. for the purposes of this constraint, an onMessage clause in a pick is equivalent to a receive (see 12.4. Pick). moreover, a reply activity must always be preceded by a receive activity for the same partner link, portType and (request / response) operation, such that no reply has been sent for that receive activity. The semantics of a process in which this constraint is violated is undefined.

Variable = "ncname"? FaultName = "QNAME"?

Standard-attributes>

Standard-Elements

?

Note that the activity corresponding to a given request has two potential forms. If the response to the request is normal, the faultName attribute is not used and the variable attribute, when present, will indicate a variable of the normal response message type ....................... ..

11.5. Updating Variable Contents

Variable Update Occurs Through The Assignment Activity, Which IS Described in 9.3. Assignment.

11.6. Signaling Faults

The throw activity can be used when a business process needs to signal an internal fault explicitly. Every fault is required to have a globally unique QName. The throw activity is required to provide such a name for the fault and can optionally provide a variable of data that provides further information about the fault. A fault handler can use such data to analyze and handle the fault and also to populate any fault messages that need to be sent to other services.BPEL4WS does not require fault names to be defined prior to their use in a throw element. An application or process-specific fault name can be directly used by using an appropriate QName as the value of the faultName attribute and providing a variable with the fault data if required. This provides a very lightweight mechanism to introduce application- Specific fixs.

Standard-Elements

A Simple Example of A Throw Activity That Does Not Provide A Variable of Fault Data IS:

11.7. Waiting

The wait activity allows a business process to specify a delay for a certain period of time or until a certain deadline is reached (see 9.1. Expressions for the grammar of duration expressions and deadline expressions).

Standard-Elements

A Typical Use of this Activity is to invoke an Operation At a Certain Time (in this case a constant, but more type):

Operation = "TextTospeech"

InputVariable = "Seasonalgreeting">

11.8. Doing Nothing

THE IS OFTEN A NEED TO USE An Activity That Does Nothing, for Example WHEN A Fault Needs to Be Caught and Suppresses. The Empty Activity is Used for this purpose. The syntax is obvious and minimal.

Standard-Elements

12. Structured Activities

Structured activities prescribe the order in which a collection of activities take place. They describe how a business process is created by composing the basic activities it performs into structures that express the control patterns, data flow, handling of faults and external events, and coordination of Message Exchanges Between Process Instances Involved in A Business Protocol.

The structured activities of bpel4ws include:

Ordinary sequential control between activities is provided by sequence, switch, and while. Concurrency and synchronization between activities is provided by flow. Nondeterministic choice based on external events is provided by pick.

Structured activities can be used recursively in the usual way. A key point to understand is that structured activities can be nested and combined in arbitrary ways. This provides a somewhat unusual but very attractive free blending of the graph-like and program-like control regimes That Have Traditionally Been Seen As Alternatives Rather Than Orthogonal Composable Features. A Simple Example of Such Blended Usage Is Found In The 6.1. Initial Example.

IT Is Important to Emphasize That The Word Activity IS Used THROUGHOUT The FOLLOWING TO INCLUDE Both Basic And Structured Activities.12.1. Sequence

A sequence activity contains one or more activities that are performed sequentially, in the order in which they are listed within the element, that is, in lexical order. The sequence activity completes when the final activity in the sequence has completed.

Standard-ElementsActivity

EXAMPLE:

...

...

...

12.2. Switch

The switch structured activity supports conditional behavior in a pattern that occurs quite often. The activity consists of an ordered list of one or more conditional branches defined by case elements, followed optionally by an otherwise branch. The case branches of the switch are considered in the order in which they appear. The first branch whose condition holds true is taken and provides the activity performed for the switch. If no branch with a condition is taken, then the otherwise branch is taken. If the otherwise branch is not explicitly specified, then An OtherWise Branch with an Empty Activity Is Deemed to Be Present. The Switch Activity IS Complete When the Activity of The SELECTED BRANCH Completes.

Standard-Elements

Activity

?

Activity

EXAMPLE:

XMLns: flt = "http://example.com/faults">

= 0>

Variable = "restockestimate" />

12.3. While

.................. ..

Standard-ElementsActivity

EXAMPLE:

...

...

"BPWS: GetVariableData (ORDERDETAILS)> 100>

...

12.4. Pick

The pick activity awaits the occurrence of one of a set of events and then performs the activity associated with the event that occurred. The occurrence of the events is often mutually exclusive (the process will either receive an acceptance message or a rejection message, but not both). If more than one of the events occurs, then the selection of the activity to perform depends on which event occurred first. If the events occur almost simultaneously, there is a race and the choice of activity to be performed is dependent on both TIMING AND IMPLEMENTATION.

The form of pick is a set of branches of the form event / activity, and exactly one of the branches will be selected based on the occurrence of the event associated with it before any others. Note that after the pick activity has accepted an event for handling, the other events are no longer accepted by that pick. The possible events are the arrival of some message in the form of the invocation of an inbound one-way or request / response operation, or an "alarm" based on a timer ( in the sense of an alarm clock) .A special form of pick is used when the creation of an instance of the business process could occur as a result of receiving one of a set of possible messages. in this case, the pick itself has a createInstance attribute with a value of yes (the default value of the attribute is no). in such a case, the events in the pick must all be inbound messages and each of those is equivalent to a receive with the attribute "createInstance = yes" No alarms are permitted for this sales.

Each pick activity MUST include at least one onMessage event. The semantics of the onMessage event is identical to a receive activity regarding the optional nature of the variable attribute and the constraint regarding simultaneous enablement of conflicting receive actions. For the latter, recall that the semantics of a process in which two or more receive actions for the same partner link, portType, operation and correlation set (s) may be simultaneously enabled is undefined (see 11.4. Providing Web Service Operations). Enablement of each onMessage handler is equivalent to enablement Of The Corresponding Receive Activity for The Purposes of this connection.

Standard-Elements

Operation = "ncname" variable = "ncname"?>

?

Activity

*

Activity

The pick activity completes when one of the branches is triggered by the occurrence of its associated event and the corresponding activity completes. The following example shows a typical usage of pick. Such a pick activity can occur in a loop that is accepting line items for a Large Order, But a completion is enabled as an alternative event.

PortType = "Ordeering"

Operation = "InputLineItem"

Variable = "lineItem">

PortType = "Ordeering"

Operation = "ORDERCOMPLETE"

Variable = "CompletionDetail">

12.5. Flow

The Flow Construct Provides Concurrency and Synchronization. The Grammar for Flow IS:

Standard-Elements

?

Activity

The standard attributes and standard elements for activities nested within a flow are especially significant because the standard attributes and elements primarily exist to provide flow-related semantics to activities.

The most fundamental semantic effect of grouping a set of activities in a flow is to enable concurrency. A flow completes when all of the activities in the flow have completed. Completion of an activity in a flow includes the possibility that it will be skipped if its enabling condition turns out to be false (see 12.5.2. Dead-Path-Elimination (DPE)). Thus the simplest use of flow is equivalent to a nested concurrency construct. In the following example, the two invoke activities are enabled to start concurrently as soon as the flow is started. The completion of the flow occurs after both the seller and the shipper respond (assuming the invoke operations were synchronous request / response). The bank is invoked only after the flow completes.

More generally, a flow activity creates a set of concurrent activities directly nested within it. It further enables expression of synchronization dependencies between activities that are nested directly or indirectly within it. The link construct is used to express these synchronization dependencies. A link has a name and all the links of a flow activity MUST be defined separately within the flow activity. The standard source and target elements of an activity are used to link two activities. The source of the link MUST specify a source element specifying the link's name and the target of the link MUST specify a target element specifying the link's name. The source activity MAY also specify a transition condition through the transitionCondition attribute of the source element. If the transitionCondition attribute is omitted, it is deemed to be present with a value of " True ". EVERY LINK DECLARED WITHIN A Flow Activity Must Have Exactly One Activity Within The Flow AS ITS Source and EXA ctly one activity within the flow as its target. The source and target of a link MAY be nested arbitrarily deeply within the (structured) activities that are directly nested within the flow, except for the boundary-crossing restrictions.The following example shows that links can cross the boundaries of structured activities. There is a link named "CtoD" that starts at activity C in sequence Y and ends at activity D, which is directly nested in the enclosing flow. The example further illustrates that sequence X must be performed prior To sequence y because x is the source of the link named "xtoy" That Is Targeted at sequence y.

In general, a link is said to cross the boundary of a syntactic construct if the source activity for the link is nested within the construct but the target activity is not, or vice versa, if the target activity for the link is nested within the construct But The Source Activity is Not.

A link MUST NOT cross the boundary of a while activity, a serializable scope, an event handler or a compensation handler (see 13. Scopes for the specification of event, fault and compensation handlers). In addition, a link that crosses a fault- handler boundary MUST be outbound, that is, it MUST have its source activity within the fault handler and its target activity within a scope that encloses the scope associated with the fault handler. Finally, a link MUST NOT create a control cycle, that is, the source activity must not have the target activity as a logically preceding activity, where an activity A logically precedes an activity B if the initiation of B semantically requires the completion of A. Therefore, directed graphs created by links are always acyclic.

12.5.1. Link Semantics

In the rest of this section, the links for which activity A is the source will be referred to as A's outgoing links, and the links for which activity A is the target will be referred to as A's incoming links. If activity X is the target of a link that has activity Y as the source, X has a synchronization dependency on Y.Every activity that is the target of a link has an implicit or explicit joinCondition attribute associated with it. This applies even when an activity has exactly one incoming link . If the explicit joinCondition is missing, the implicit condition requires the status of at least one incoming link to be positive (see below for an explanation of link status). A join condition is a Boolean expression (see 9.1. Expressions). The expression For a join condition for an Activity Must Be Constructed Using Only Boolean Operators and The BPWS: GetLinkStatus Function (See 9.1. Expressions) Applied to Incoming Links At the Activity.

Without considering links, the semantics of business processes, scopes, and structured activities determine when a given activity is ready to start. For example, the second activity in a sequence is ready to start as soon as the first activity completes. An activity that defines the behavior of a branch in a switch is ready to start if and when that branch is chosen. Similarly, an activity nested directly within a flow is ready to start as soon as the flow itself starts, because flow is fundamentally a concurrency construct.

If an activity that is ready to start in this sense has incoming links, then it does not start until the status of all its incoming links has been determined and the (implicit or explicit) join condition associated with the activity has been evaluated. The precise SEMANTICS OF LINK STATUS Evaluation Area Follows: When Activity a completions, The Following Steps Are Performed To Determine The Effect of The Synchronization Links On Other Activities:

Determine the status of all outgoing links for A. The status will be either positive or negative. To determine the status for each link its transitionCondition is evaluated. Note that the evaluation is carried out with the actual values ​​of the variables referenced in the transition condition expression. If some of the variables are modified in a concurrent behavior path, the result of the transition condition evaluation may depend nondeterministically on the timing of behavior among concurrent activities. If the value is true the status is positive, otherwise it is negative. For Each Activity B That Has A Synchronization Dependency on A, Check WHETHER:

B is ready to start (except for its dependency on incoming links) in the sense described above. The status of all incoming links for B has been determined. If both these conditions are true, then evaluate the join condition for B. If the join Condition Evaluates to False, A Standard BPWS: Joinfailure Fault Is Thrown, OtherWise Activity B Is Started.

If, during the performance of structured activity S, the semantics of S dictate that activity X nested within S will not be performed as part of the behavior of S, then the status of all outgoing links from X is set to negative. An example is an activity within a branch that is not taken in a switch activity, or activities that were not completed in a scope in which processing was halted due to a fault, including a bpws: joinFailure (. see 13. Scopes and 13.3 Compensation Handlers). Note That In General Multiple Target Activities Will Be Enabled Based on The Completion of an Activity With Multiple Outgoing Links; Because of this, Such An Activity is offen called a fork activity.

12.5.2. Dead-path-Elimination (DPE)

In cases where the control flow is largely defined by networks of links, the normal interpretation of a false join condition for activity A is that A should not be performed, rather than that a fault has occurred. Moreover, there is a need to propagate the . consequences of this decision by assigning a negative status to the outgoing links for A. BPEL4WS makes it easy to express these semantics by using an attribute suppressJoinFailure on an activity A value of "yes" for this attribute has the effect of suppressing the bpws: joinFailure fault for the activity and all nested activities, except where the effect is overridden by using the suppressJoinFailure attribute with a value of "no" in a nested activity Suppressing the bpws:. joinFailure is equivalent to the fault being logically caught by a special default Handler attached to an an an an empty activity, what is, the handler sumedier beh ppresses the fault and does nothing about it. However, because the activity with the join condition was not performed, its outgoing links are automatically assigned a negative status according to the rules of 12.5.1. Link Semantics. Thus within an activity with the value Of the supportjoinfailure attribute set to "yes"

, The semantics of a join condition that evaluates to false are to skip the associated activity and to set the status of all outgoing links from that activity to negative. This is called dead-path-elimination because in a graph-like interpretation of networks of links with transition conditions, these semantics have the effect of propagating negative link status transitively along entire paths formed by consecutive links until a join condition is reached that evaluates to true.Note that the name of the implicit scope (created to suppress the bpws: joinFailure ) that immediately encloses an activity with a join condition is exactly the same as the name of the activity itself. In case this is an invoke activity (see 11.3. Invoking Web Service Operations) with an inlined fault or compensation handler, the implicit scope for The Fault and Compensation Handlers IS Merged With The Implicit Scope Described here, Which Adds An Additional Fault Handler for the bpws: joinfail.

The default value of the suppressJoinFailure attribute is "no". This is to avoid unexpected behavior in simple use cases where complex graphs are not involved and links without transition conditions are used for synchronization. The designers of such use cases are likely to be naive about link semantics and are likely to be surprised by the consequences of a default interpretation that suppresses a well-defined fault. For example, consider the interpretation of the 6.1. Initial Example with the suppressJoinFailure attribute set to "yes". Suppose further that the invocations of the shippingProvider are enclosed in a scope that provides a fault handler (see 13. Scopes and 13.4. Fault Handlers). If one of these invocations were to fault, the status of the outgoing link from the invocation would be negative, and the ( Implicit) Join Condition At The Target of The Resulting BE falge skipped within the sequence instead of causing the expected fault.If universal suppression of the bpws: joinFailure is desired, it is easy to achieve by using the suppressJoinFailure attribute with a value of "yes" in the overall process element at the root of the business Process definition.

12.5.3. Flow Graph EXAMPLE

In the following example, the activities with the names getBuyerInformation, getSellerInformation, settleTrade, confirmBuyer, and confirmSeller are nodes of a graph defined through the flow activity The following links are defined.:

The link named buyToSettle starts at getBuyerInformation (specified through the corresponding source element nested in getBuyerInformation) and ends at settleTrade (specified through the corresponding target element nested in settleTrade). The link named sellToSettle starts at getSellerInformation and ends at settleTrade. The link named toBuyConfirm starts at settleTrade and ends at confirmBuyer. The link named toSellConfirm starts at settleTrade and ends at confirmSeller.Based on the graph structure defined by the flow, the activities getBuyerInformation and getSellerInformation can run concurrently. The settleTrade activity is not performed before both of these activities Are Completed. After SetTletrade Completes The Two Activities, Confirmbuyer and Confirmseller Are Performed Concurrently Again.

JOINCONDITION = "BPWS: getLinkStatus ('Buytosettle') and

BPWS: GetLinkStatus ('Selltosettle') ">

12.5.4. Links and Structured Activities

Links can cross the boundaries of structured activities. When this happens, care must be taken to ensure the intended behavior of the business process. The following example illustrates the behavior when links target activities within structured constructs.

The following flow is intended to perform the sequence of activities A, B, and C. Activity B has a synchronization dependency on the two activities X and Y outside of the sequence, that is, B is a target of links from X and Y. The join condition at B is missing, and therefore implicitly assumed to be the default, which is the disjunction of the status of the links targeted to B. The condition is therefore true if at least one of the incoming links has a positive status. In .................... ..

In the flow, the sequence S and the two receive activities X and Y are all concurrently enabled to start when the flow starts. Within S, after activity A is completed, B can not start until the status of its incoming links from X and Y is Determined and the implicit Join Condition is evatated .hen activities x and y completed.

Suppose that the expression P (X, B) OR P (Y, B) evaluates to false In this case, the standard fault bpws:. JoinFailure will be thrown, because the environmental attribute suppressJoinFailure is set to "no" Thus the behavior. of the flow is interrupted and neither B nor C will be performed.If, on the other hand, the environmental attribute suppressJoinFailure is set to "yes", then B will be skipped but C will be performed because the bpws: joinFailure will be suppressed By The Implicit Scope Associated with B.

...

...

...

...

...

Finally, assume that the preceding flow is slightly rewritten by linking A, B, and C through links (with transition conditions with constant truth-value of "true") instead of putting them into a sequence. Now, B and thus C will always be performed. Because the join condition is a disjunction and the transition condition of link AtoB is the constant "true", the join condition will always evaluate to "true", independent from the values ​​of P (X, B) and P (Y , B).

13. Scopes

The Behavior Context For Each Activity is provided by a scope. A Scope Can Provide Fault Handlers, Event Handlers, a Compensation Handler, Data Variables, and Correlation Sets.

All scope elements are syntactically optional and some have default semantics when omitted The syntax and semantics of scopes are explained in detail below..

Standard-Elements

?

...

?

...

?

...

?

...

?

...

Activity

Each scope has a primary activity that defines its normal behavior. The primary activity can be a complex structured activity, with many nested activities within it to arbitrary depth. The scope is shared by all the nested activities. In the following example, the scope has a primary flow activity, which contains two concurrent invoke activities. Either of the invoke activities can receive one or more types of fault responses. The fault handlers for the scope are shared by both invoke activities and can be used to catch the faults caused by the Possible Fault Responses.

?

...

Operation = "syncpurchase"

InputVariable = "sendpo"

Outputvariable = "getResponse" />

PortType = "Ship: Transportorders"

Operation = "ORDERSHIPMENT"

InputVariable = "sendshiporder"

Outputvariable = "shipack" />

13.1. Data HANDLING

A Scope Can Have Defined Variables That Live ONLY WITHIN THE CHE CHApter About 9. Data Handling.13.2. Error Handling In Business Processes

Business processes are often of long duration and use asynchronous messages for communication. They also manipulate sensitive business data in back-end databases and line-of-business applications. Error handling in this environment is both difficult and business critical. The use of ACID transactions is usually limited to local updates because of trust issues and because locks and isolation can not be maintained for the long periods during which technical and business errors and fault conditions can occur in a business process instance. As a result, the overall business transaction can fail or be cancelled after many ACID transactions have been committed during its progress, and the partial work done must be undone as best as possible. Error handling in business processes therefore relies heavily on the well-known concept of compensation, that is, application-specific activities That Attempt to Reverse The Effects of a Previous Activity That Was Carried Out As Part of A Larger Unit of W ork that is being abandoned. There is a long history of work in this area regarding the use of [Sagas] and [Open Nested Transactions]. BPEL4WS provides a variant of such a compensation protocol by providing the ability for flexible control of the reversal. BPEL4WS ACHIEVES THIS BY Providing The Ability TO Define Fault Handling and Compensation In An Application-Specific Manner, Resulting In A Feature Called Long-Running (Business) Transactions (LRTS).

It is important to understand that the notion of LRT described here is meant to be used purely within a platform-specific implementation. There is no prescribed requirement that the business process be distributed or span multiple vendors and platforms. For such environments, it is expected that the WS-Transaction specification [WS-Transaction] would be utilized to register participants interested in the reversal notifications provided by the LRT implementation See 20.3 Appendix C -.. Coordination Protocol for a detailed model of BPEL4WS LRTs based on WS-Transaction concepts. Additionally, it is important to understand that the notion of LRT described here is purely local and occurs within a single business process instance. There is no distributed coordination regarding an agreed-upon outcome among multiple-participant services. The achievement of distributed agreement is an Orthogonal Problem Outside The Scope of Bpel4ws, To Be Solved by Using The Protocols Described in The WS-Transac Tion Specification. The NEED TO Compose WS-Transaction with Bpel4ws is recognized.

As an example of an LRT, consider the planning and fulfillment of a travel itinerary. This can be viewed as an LRT in which individual service reservations can use nested transactions within the scope of the overall LRT. If the itinerary is cancelled, the reservation transactions must be compensated for by cancellation transactions, and the corresponding payment transactions must be compensated accordingly. for ACID transactions in databases the transaction coordinator (s) and the resources that they control know all of the uncommitted updates and the order in which they must be reversed , and they are in full control of such reversal. in the case of business transactions, the compensation behavior is itself a part of the business logic and protocol, and must be explicitly specified. for example, there might be penalties or fees applied for cancellation Of an airline reservation depending on the class of ticket and the timing. if a payroll advance has been given to pay for the traffic, th e reservation must be successfully cancelled before the payroll advance for it can be reversed in the form of a payroll deduction. This means the compensation actions might need to run in the same order as the original transactions, which is not the standard or default in most Transaction Systems. Using Activity Scopes As The Definition of Logical Units Of Work, The Lrt Feature of Bpel4ws Addresses these Requirements.13.3. Compensation Handlers

Scopes can delineate a part of the behavior that is meant to be reversible in an application-defined way by a compensation handler. Scopes with compensation and fault handlers can be nested without constraint to arbitrary depth.

13.3.1. Defining a Compensation Handler

A compensation handler in the current version of BPEL4WS is simply a wrapper for a compensation activity as shown below. It is recognized that in many scenarios the compensation handler needs to receive data about the current state of the world and return data regarding the results of the COMPENSATION. ?

Activity

AS Explained in 11.3. Invoking Web Service Operations, There IS A Special Shortcut for The Invoke Activity To Inline A Compensation Handler Rather Than Explicitly Using An Immediately Enclosing Scope. For example:

Operation = "syncpurchase"

InputVariable = "sendpo"

Outputvariable = "getResponse">

Pattern = "OUT" />

Operation = "cancelpurchase"

InputVariable = "getResponse"

Outputvariable = "getconfirmation">

In this example, the original invoke activity makes a purchase and in case that purchase needs to be compensated, the compensationHandler invokes a cancellation operation at the same port of the same partnerLink, using the response to the purchase request as the input.

In Standard Syntax (WITHOUT THE Invoke Shortcut) This Example Would Be Equivalently Expressed As Follows:

Operation = "cancelpurchase"

InputVariable = "getResponse"

Outputvariable = "getconfirmation">

Operation = "syncpurchase"

InputVariable = "sendpo"

Outputvariable = "getResponse">

Pattern = "OUT" />

Note that the variable getResponse can be reused later for other purposes before compensation is invoked. But the compensation handler needs the specific response to the invoke operation that is being reversed. BPEL4WS semantics state that the compensation handler, if invoked, will see a frozen snapshot of all variables, as they were when the scope being compensated was completed. In other words, if the compensation handler shown here is used, the contents of getResponse that it will see and use are exactly the contents at the time of the completion of the invoke activity it compensates. This also means that compensation handlers can not update live data in the variables that the business process is using. They live entirely in a snapshot world. A compensation handler, once installed, can be thought of as a completely self-contained Action That Is Not Affected by and Does Not Affect, The Global State of The Business Process Instance. It can Only Affect External Entities.it Is Not Reali stic to expect compensation activities to always be oblivious to the current state of the world. In fact, compensation both affects and is affected by the current state. However, the shape of the world within which compensation is run is difficult to anticipate. It is therefore necessary to allow the two-way interaction between compensation activities and the live world to take place in a tightly controlled manner. in the future, BPEL4WS will add input and output parameters to compensation handlers for this purpose.

As stated in 6.4. The Lifecycle of a Business Process, if a compensation handler is specified for the business process as a whole, a business process instance can be compensated after normal completion by platform-specific means. This functionality is enabled by setting the enableInstanceCompensation Attribute of theprocess to "yes" .13.3.2. Invoking a Compensation Handler

The compensation handler can be invoked by using the compensate activity, which names the scope for which the compensation is to be performed, that is, the scope whose compensation handler is to be invoked. A compensation handler for a scope is available for invocation only when the scope completes normally. Invoking a compensation handler that has not been installed is equivalent to the empty activity (it is a no-op) -this ensures that fault handlers do not have to rely on state to determine which nested scopes have completed successfully. The Semantics of a Process In Which An Installed Compensation Handler Is Invoked More Than Once is undefined.

Note That In Case An Invoke Activity Has A Compensation Handler Defined Inline, The Name of The Activity Is The Name of The Scope To Be.com.

Standard-Elements

The ability to explicitly invoke the compensate activity is the underpinning of the application-controlled error-handling framework of BPEL4WS This activity can be used only in the following parts of a business process.:

In a fault handler of the scope that immediately encloses the scope for which compensation is to be performed In the compensation handler of the scope that immediately encloses the scope for which compensation is to be performed.Example.:

IF a scope being complensated by name Was Nested in a loop, The Instances of The Compensation Handlers In The Success ITerations Are Invoked in Reverse Order.

IF The Compensation Handler for A Scope Is Absent, The Default Compensation Handler Invokes The Compensation Handlers for The Reverse Order of The Completion of Those Scopes.

The form, in which the scope name is omitted in a compensate activity, causes this default behavior to be invoked explicitly. This is useful when an enclosing fault or compensation handler needs to perform additional work, such as updating variables or sending external notifications, in addition to performing default compensation for inner scopes. Note that the activity in a fault or compensation handler attached to scope S causes the default-order invocation of compensation handlers for completed scopes directly nested within S. The use of this activity can be mixed with any other user-specified behavior except the explicit invocation of for scope Sx nested directly within S. Explicit invocation of compensation for such a scope nested within S disables the availability of DEFAULT-ORDER COMPENSATION, AS EXPECTED.

13.4. Fault Handlers

Fault handling in a business process can be thought of as a mode switch from the normal processing in a scope. Fault handling in BPEL4WS is always treated as "reverse work" in that its sole aim is to undo the partial and unsuccessful work of a scope in which a fault has occurred. The completion of the activity of a fault handler, even when it does not rethrow the fault handled, is never considered successful completion of the attached scope and compensation is never enabled for a scope that has had an associated fault handler invoked.The optional fault handlers attached to a scope provide a way to define a set of custom fault-handling activities, syntactically defined as catch activities. Each catch activity is defined to intercept a specific kind of fault, defined by a globally unique fault Qname and a variable for the data associated with the fault. If the fault name is missing, then the catch will intercept all faults with the right type of fault data. The fault variable isot data d using the faultVariable attribute in a catch handler. The variable is deemed to be declared by virtue of being used as the value of this attribute and is local to the fault handler. It is not visible or usable outside the fault handler in which it is Decland. The fault variable is Optional Because A Fault Might Not Have Additional Data Associated with it.

A fault response to an invoke activity is one source of faults, with obvious name and data aspects based on the definition of the fault in the WSDL operation. A programmatic throw activity is another source, again with explicitly given name and data. The core concepts and exexutable pattern extensions of BPEL4WS define several standard faults with their names and data, and there might be other platform-specific faults such as communication failures that can occur in a business process instance. A catchAll clause can be added to catch any fault not caught By A More Specific Catch Handler. ?

*

Activity

?

Activity

. Because of the flexibility allowed in expressing the faults that a catch activity can handle, it is possible for a fault to match more than one fault handler The following rules are used to select the catch activity that will process a fault:

If the fault has no associated fault data, a catch activity that specifies a matching faultName value will be selected if present. Otherwise, the default catchAll handler is selected if present. If the fault has associated fault data, a catch activity specifying a matching faultName value and a faultVariable whose type (WSDL message type) matches the type of the fault's data will be selected if present. Otherwise, a catch activity with no specified faultName and with a faultVariable whose type matches the type of the fault data will be selected if Present. OtherWise, The Default Catchall Handler Is Selected IF Present.

If no catch or catchall is selected, the fault is not caught by the current scope and is rethrown to the immediately enclosing scope (see 13.4.1. Implicit Fault and Compensation Handlers for a more complete description of the default fault and compensation handling behavior) . If the fault occurs in (or is rethrown to) the global process scope, and there is no matching fault handler for the fault at the global level, the process terminates abnormally, as though a terminate activity had been performed.Consider the following example :

Assume that a fault named "x: foo" is thrown The first catch will be selected if the fault carries no fault data If there is fault data associated with the fault, the third catch will be selected if and only if the type of.. the fault's data matches the type of variable "bar", otherwise the default catchall handler will be selected Finally, a fault with a fault variable whose type matches the type of "bar" and whose name is not. "x: foo" will be Processed by The Second Catch. All The default catchall handler.

Although the use of compensation can be a key aspect of the behavior of fault handlers, each handler performs an arbitrary activity, which can even be . When a fault handler is present, it is in charge of handling the fault. It might rethrow the same fault or a different one, or it might handle the fault by performing cleanup and allowing normal processing to continue in the enclosing scope.A scope in which a fault occurred is considered to have ended abnormally, whether or not the fault was Caught and handled without Rethrow by a fault handler. A Compensation Handler Is Never Installed for a Scope in Which a fault occurred.

When a fault handler for scope S handles a fault that occurred in S without rethrowing, links that have S as the source will be subject to regular evaluation of status after the fault has been handled, because processing in the enclosing scope is meant to be continued .

AS Explained in 11.3. Invoking Web Service Operations, There IS A Special Shortcut for the Invoke Activity To Inline Fault Handlers Rather Than Explicitly Using An Immediately Enclosing Scope. For Example:

PortType = "sp: purchaasing"

Operation = "syncpurchase"

InputVariable = "sendpo"

Outputvariable = "getResponse">

In this example, the original invoke makes a purchase and a fault handler is inlined to handle the case where the purchase request results in a fault response In standard syntax (without the invoke shortcut), this example would be equivalently expressed as follows.:

PortType = "sp: purchaasing"

Operation = "syncpurchase"

InputVariable = "sendpo"

Outputvariable = "getResponse">

The compensation handler for scope C becomes available for invocation by the fault and compensation handlers for its immediately enclosing scope exactly when scope C completes normally. A fault handler for scope C is available for invocation exactly when C has commenced but has not been completed. If the scope faults before completion, then the appropriate fault handler gets control and all other fault handlers are uninstalled. It is never possible to run more than one fault handler for the same scope under any circumstances.

Note That Availability Also Applies To 13.4.1. Implicit Fault and Compensation Handlers.

The behavior of a fault handler for scope C begins by implicitly terminating all activities that are currently active and directly enclosed within C (see 13.4.2. Semantics of Activity Termination). The termination of these activities occurs before the specific behavior of a fault handler Is Started. This Also Applies To The Implicit Fault Handlers Described Below. The Activity of a Fault Handler Is Deemed To Occur in The Scope To Which The Fault Handler Is Attached.

13.4.1. Implicit Fault And Compensation Handlers

Because the visibility of scope names and therefore of compensation handlers is limited to the next enclosing scope, the ability to compensate a scope would be lost if the enclosing scope did not have a compensation handler or was missing a fault handler for some fault. Because many faults are not programmatic or the result of operation invocation, it is not reasonable to expect an explicit handler for every fault in every scope. BPEL4WS therefore provides default compensation and fault handlers when these are missing. The behavior of these implicit handlers is to run available compensation handlers in the reverse order of completion of the corresponding scopes. This is defined in more precise terms below.Whenever a fault handler (for any fault) or the compensation handler is missing for any given scope, they are implicitly created with the following behavior :

Fault Handler:

Run All Available Compensation Handlers for Immediately Enclosed Scopes in The Reverse Order of Completion of The Corresponding Scopes. Rethrow The Fault To The next Enclosing Scope.

Compensation handler:

Run All Available Compensation Handlers For Immediately Enclosed Scopes in The Reverse Order of Completion of The Corresponding Scopes.

13.4.2. Semantics of Activity Termination

As stated above, the behavior of a fault handler for scope C begins by implicitly terminating all activities directly enclosed within C that are currently active. The following paragraphs define what this means for all BPEL4WS activity types.

The assign activities are sufficiently short-lived that they are allowed to complete rather than being interrupted when termination is forced. The evaluation of expressions when already started is also allowed to complete. Each wait, receive, reply and invoke activity is interrupted and terminated prematurely . When a synchronous invoke activity (corresponding to a request / reply operation) is interrupted and terminated prematurely, the response (if received) for such a terminated activity is silently discarded. The notion of termination does not apply to empty, terminate, and throw .All structured activity behavior is interrupted. The iteration of while is interrupted and termination is applied to the loop body activity. If switch has selected a branch, then the termination is applied to the activity of the selected branch. The same applies to pick. IF Either of these Activities Has NOT YET SELECTED A BRANCH, THEN THE SWITCH AND THE PICK Are Terminated Immediately. The Sequence and Flow For the All Nested Activities Currently Active Wtem, Terminating Terminated by Terminating To All Nested Activities Currently Active Wtem.

Scopes provide the ability to control the semantics of forced termination to some degree When the activity being terminated is in fact a scope, the behavior of the scope is interrupted and the fault handler for the standard bpws:. ForcedTermination fault is run Note that this. . applies only if the scope is in normal processing mode If the scope has already experienced an internal fault and invoked a fault handler, then as stated above, all other fault handlers including the handler for bpws: forcedTermination are uninstalled, and the forced termination has . no effect The already active fault handler is allowed to complete.The fault handler for the bpws:. forcedTermination fault is designed like other fault handlers, but this fault handler can not rethrow any fault Even if an uncaught fault occurs during its behavior, it is NOT RETROWN to the next enclosing scope. this is because the Enclosing Scope Has Already Faulted, Which is what is causing the forced termination of the netsted scope.

In other respects this is a normal fault handler. Its behavior begins by implicitly (recursively) terminating all activities directly enclosed within its associated scope that are currently active. It can invoke compensate activities. And when it is missing, it is provided by using the Same Implicit Behavior That Is Used for All Other Implicit Fault Handlers.

Note that forced termination of nested scopes occurs in innermost-first order as a result of the rule (quoted above) that the behavior of any fault handler begins by implicitly (recursively) terminating all activities directly enclosed within its associated scope that are currently active.

13.4.3. Handling Faults That Occur Inside Fault And Compensation Handlers

Compensation handlers are always invoked directly or indirectly as part of the processing of some fault handler E. The behavior of a compensation handler invoked by E can cause a fault to be thrown. Such a fault, if uncaught by scopes within the chain of compensation handlers Invoked by E, IS TREATED AS Being A Fault Within E.if A Fault Occurs In A Fault Handler E for a Scope C, The Fault Can Be Caught Through The Use of a Scope Withnin E. IF The Fault Is Not Caught By A Scope within E, it is immediately thrown to the parent scope of C and the behavior of E terminates prematurely. in effect, no distinction is made between faults that E rethrows deliberately and faults that occur as undesired faults in E.

13.5. Event Handlers

The whole process as well as each scope can be associated with a set of event handlers that are invoked concurrently if the corresponding event occurs. The actions taken within an event handler can be any type of activity, such as sequence or flow, but invocation of compensation handlers using the activity is not permitted. As stated earlier, the activity can only be used in fault and compensation handlers. There are two types of events. First, events can be incoming messages that correspond to a request / response or oneway operation in WSDL. For instance, a status query is likely to be a request / response operation, whereas a cancellation may be a oneway operation. Second, events can be alarms, that go off after user- Set Times. The Grammar for the Set of Event Handlers Associated with a scope or process IS

?

OnAlarm Handler ->

Variable = "ncname"?> *

?

Activity

*

Activity

IT Is Important To Emphasize That Event Handlers Are Considered A Part of The Normal Behavior of The Scope, Unlike Fault And Compensation Handlers.

13.5.1. Message Events

The onMessage tag indicates that the event specified is an event that waits for a message to arrive. The interpretation of this tag and its attributes is very similar to a receive activity. The partnerLink attribute defines the partner link on which the request is expected to arrive ;.. the partnerLink must be defined in the partnerLinks section The portType and operation attributes define the appropriate port type and operation that is invoked by the partner in order to cause the event The variable attribute identifies the variable which contains the message received from the partner . Note that the operation may be either an asynchronous (oneway) or a synchronous (request / response) operation. In the latter case the event handler is expected to use a reply activity to send the response. The usage and interpretation of correlation is exactly The Same As For Receive Activities. It Should Also Be Nonded That An Event Cannot Create a Process Instance.

The semantics of the onMessage event is identical to a receive activity regarding the optional nature of the variable attribute and the constraint regarding simultaneous enablement of conflicting receive actions. For the latter, recall that the semantics of a process in which two or more receive actions for the same partner link, portType, operation and correlation set (s) may be simultaneously enabled is undefined (see 11.4. Providing Web Service Operations). Enablement of each onMessage event handler is equivalent to enablement of the corresponding receive activity for the purposes of this constraint.As specified in the grammar above, event handlers for message events are not permitted to carry the createInstance attribute. A business process instance can not be created by a message event. This is because the event handler can not be enabled until the instance is created.

When the message constituting an event arrives, the activity specified in the corresponding handler is carried out. The key point to understand is that the business process is enabled to receive such messages concurrently with the normal activity of the scope to which the event handler is attached ...................... ..

The following example shows the usage of an event handler to support the termination of a process instance through an external message. Alternatively, the event handler could throw a fault to cause the ongoing work to be undone and compensated.

...

Porttype = "car" Operation = "ca Zancel"

Variable = "canceldetails">

...

...

In this example, if the buyer invokes the cancel operation on the port type car, the terminate activity is carried out, which results in immediate termination of the process instance without the ongoing work being undone and compensated. And this event is attached to the global Process Scope and is the the the the center of the entire business process instance.

13.5.2. ALARM EVENTS

The onAlarm tag marks a timeout event. The for attribute specifies the duration after which the event will be signaled. The clock for the duration starts at the point in time when the associated scope starts. The alternative until attribute specifies the specific point in time when .

13.5.3. Enablement of Events

The Event Handlers Associated with a scope area.

If the event handler is associated with the global process scope, the event handler is enabled as soon as the process instance is created. The process instance is created when the first receive activity that provides for the creation of a process instance (indicated via the createInstance attribute set to yes) has received and processed the corresponding message This allows the alarm time for a global alarm event to be specified using the data provided within the message that creates a process instance, as shown in the following example.:

Targetnamespace = "http://www.example.com/wsdl/exmple"

XMLns: xsd = "http://www.w3.org/2001/xmlschema" ...>

TYPE = "xsd: duration" />

The message type above is buy in

XMLns: DEF = "http://www.example.com/wsdl/example" ...>

...

BPWS: GetVariableData (OrderDetails, ProcessDuration "

>

...

...

...

...

PartnerLink = "buyer"

PortType = "car"

Operation = "ORDER"

Variable = "ORDERDETAILS"

CreateInstance = "yes" />

...

The onAlarm tag specifies a timer event that is fired when the duration specified in the processDuration field in the orderDetails variable is exceeded. The value of the field is provided via the getOrder activity that receives message containing the order details and causes the creation of a process INSTANCE for That Order.

13.5.4.1 Alarm Events

The counting of time for an alarm event with a duration starts when the enclosing event handler is activated. An alarm event goes off when the specified time or duration has been reached. An alarm event is carried out at most once while the corresponding scope is active . The reason.............

13.5.4.2 Message Events

A message event occurs when the appropriate message is received on the specified partner link using the specified port type and operation. When such an event occurs, the corresponding activity is carried out. However, the event remains enabled, even for concurrent use. Thus a Particular Message Event Can Occur Multiple Times While The Corresponding Scope is Active. See Below for Concurrency Considerations.13.5.4. Disablement of Events

All event handlers associated with a scope are disabled when the normal processing of the scope is complete. The already dispatched event handlers are allowed to complete. The completion of the scope as a whole is delayed until all active event handlers have completed.

13.5.5. Fault Handling Considances

As we stated above, event handlers are considered a part of the normal processing of the scope, ie, active event handlers are concurrent activities within the scope. Faults within event handlers are therefore faults within the associated scope. Moreover, if a fault occurs within a scope, the behavior of the fault handler begins by implicitly terminating all activities directly enclosed within the scope that are currently active. This includes the activities within currently active event handlers.

13.5.6. Concurrency Considances

Multiple message and alarm events can occur concurrently and they are treated as concurrent activities even if they are request / response events representing the same partner link, port type, operation and correlation sets. The constraint that there can be at most one outstanding synchronous request on a given partner link at a given port type and operation applies here as well (see 11.4. Providing Web Service Operations). Concurrent invocation of event handlers necessarily relies heavily on the use of serializable scoping to ensure consistent access to shared variables.13.6. Serializable Scopes

When the variableAccessSerializable attribute is set to "yes", the scope provides concurrency control in governing access to shared variables. Such a scope is called a serializable scope. Serializable scopes must not be nested. A scope marked with variableAccessSerializable = "yes" must be a leaf scope.

Suppose two concurrent serializable scopes, S1 and S2, access a common set of variables (external to them) for read or write operations. The semantics of serializability ensure that the results of their behavior would be no different if all conflicting activities (read / write and write / write activities) on any shared variable were conceptually reordered in such a way that either all activities within S1 are completed before those in S2 or vice versa. The actual mechanisms used to ensure serializability are implementation dependent.

The Use of Error Handling Features in a serializable scope is governed by the following rules:

The fault handlers for a serializable scope share the serializability domain of the associated scope, that is, in case a fault occurs in a serializable scope, the behavior of the fault handler is considered part of the serializable behavior (in commonly used implementation terms, locks are not released when making the transition to the fault handler). This is because the repair of the fault needs a shared isolation environment to provide predictable behavior. The compensation handler for a serializable scope does not share the serializability domain of the associated scope. for a serializable scope with a compensation handler, the creation of the state snapshot for compensation is part of the serializable behavior. In other words, it is always possible to reorder behavior steps as if the scope had sufficiently exclusive access to the shared variables all the way To Completion, Including The Creation of the Snapshot.it IS Useful to Note That The Semantics of Serializable Scopes Are V Ery Similar To The Standard Isolation Level "Serializable" Used in Database Transactions.

14. Extensions for Executable Processes

......... #...............

14.1. Expressions

The 9.1. Expressions Feature of Bpel4ws.

THE FIRST EXTENSION Defines A Standard Fault For Errorneous Use of the xpath 1.0 function defined for extracting global property value from variables.

BPWS: GetVariableProperty ('Variablename', 'PropertyName')

The first argument names the source variable for the data and the second is the qualified name (QName) of the global property to select from that variable (see 8. Message Properties). If the given property does not appear in any of the parts of the variable's message type or the given property definition selects a node set of a size other than one, then the standard fault bpws: selectionFailure MUST be thrown by a compliant implementation.The second extension defines an additional XPath 1.0 function usable only in executable processes. This function excects arbitrary value from variables.

BPWS: GetVariableData ('Variablename', 'Partname'?, 'locationpath'?)

The first argument names the source variable for the data, the second and third arguments are optional. When present, the second names the part to select from that variable, and the third optional argument, when present, provides an absolute location path (with ' / 'meaning the root of the document fragment representing the function fragment representing the part.

When only the first argument is present, the function extracts the value of the variable, which in this case must be defined using an XML Schema simple type or element. Otherwise, the return value of this function is a node set containing the single node representing either an entire part of a message type (if the second argument is present and the third argument is absent) or the result of the selection based on the locationPath (if both optional arguments are present). If the given locationPath selects a node set of A Size Other Than One During Execution, The Standard Fault BPWS: SelectionFailure Must Be Thrown By A Compliant Implementation.14.2. Variables

THESE EXTENSIONS Apply to the 9.2. Variables Feature of Bpel4ws.

An Attempt During Process Execution To Use any Part of a Variable Before It is Initialized Must Result In The Standard BPWS: UninitializedVariable Fault.

14.3. Assignment

The 9.3. Assignment Feature of Bpel4ws.

The First Extension Adds An Additional Assignment Form.

In The First from-Spec and To-Spec Variants of Assignment, An Optional Query Attribute May Be Used In Executable Processes, Yielding The Forms

The value of the query attribute is a query string to identify a single value within a source or target variable part. BPEL4WS provides an extensible mechanism for the language used in these queries. The language is specified by the attribute "queryLanguage" of the element Compliant implementations of the current version of BPEL4WS MUST support the use of XPath 1.0 as the query language XPath 1.0 is indicated by the default value of the queryLanguage attribute, which is: http: //www.w3.org/TR / 1999 / REC-XPATH-19991116

For XPath 1.0, the value of the query attribute MUST be an absolute locationPath (with '/' meaning the root of the document fragment representing the entire part). It is used to identify the root of a subtree within the document fragment representing the part .. The location path MUST select exactly one node If the location path selects zero nodes or more than one node during execution, then the standard fault bpws: selectionFailure MUST be thrown by a compliant implementation.

.. The second extension defines a standard fault for violation of type matching constraints If any of the matching constraints defined in the section 9.3.1 Type Compatibility in Assignment is violated during execution, the standard fault bpws: mismatchedAssignmentFailure MUST be thrown by a compliant implementation .

The second extension defines the behavior of assignment in the presence of failure during execution. An important characteristic of assignment in BPEL4WS is that assignment activities are atomic. If there is any fault during the execution of an assignment activity, the destination variables are left unchanged as THEY WERE AT The Start of the Activity. This Applies Regardless of the number of assignment elements within the Overall Assignment Activity.14.4. Correlation

After a correlation set is initiated, the values ​​of the properties for a correlation set must be identical for all the messages in all the operations that carry the correlation set and occur within the corresponding scope until its completion. If at execution time this constraint is violated , the standard fault bpws:. correlationViolation MUST be thrown by a compliant implementation The same fault MUST be thrown if an activity with the initiate attribute set to no attempts to use a correlation set that has not been previously initiated.

14.5. Web Service Operations

The First Extension Defines A Standard Fault For the Case Where Multiple Conflicting Receive Activities Create Ambiguity About Message Delivery.

If during the execution of a business process instance, two or more receive activities for the same partner link, portType, operation and correlation set (s) are in fact simultaneously enabled, then the standard fault bpws: conflictingReceive MUST be thrown by a compliant implementation .

The Second Extension Defines A Standard Fault For the Case Where Multiple Outstanding Synchronous Requests Create An Ambiguity About Response Correlation.

If more than one outstanding synchronous request on a specific partner link for a particular portType, operation and correlation set (s) is outstanding simultaneously during the execution of a business process instance, then the standard fault bpws: conflictingRequest MUST be thrown by a compliant implementation . Note that this is semantically different from the bpws:. conflictingReceive, because it is possible to create the conflictingRequest by consecutively receiving the same request on a specific partner link for a particular portType, operation and correlation set (s) If a reply activity is being carried out during the execution of a business process instance and no synchronous request is outstanding for the specified partnerLink, portType, operation and correlation set (s), then the standard fault bpws: invalidReply MUST be thrown by a compliant implementation.The third extension Specifies That The InputVariable Attribute for Invoke and the Variable Attribute for Receive and Reply Acti VITIES ARE NOT OPTIONAL IN Addition, The OutputVariable Attribute IS NOT OPTIONAL for Invoke When the Operation Concerned Is A Request / Response Operation.

14.6. Terminating a Service Instance

The terminate activity can be used to immediately terminate the behavior of a business process instance within which the terminate activity is performed. All currently running activities MUST be terminated as soon as possible without any fault handling or compensation behavior.

Standard-Elements

14.7. Compensation

IF An Installed Compensation Handler Is Invoked More Than Once During The Execution of A Process Instance, a Compliant Implementation Must Throw The Standard BPWS: Repeatedcompensation Fault.14.8. Event Handlers

This extension explains the relationship of onMessage event handlers to the standard fault extension in 14.5. Web Service Operations for multiple conflicting receive activities create ambiguity about message delivery.

Enablement of an onMessage event handler is equivalent to enablement of a receive activity for the semantics of the occurrence of the bpws: conflictingReceiveFault fault (. See 11.4 Providing Web Service Operations).

The inputVariable attribute for omMessage handlers is not optional in executable processes. In addition, the outputVariable attribute is not optional for invoke when the operation concerned is a request / response operation.

15. EXTENSIONS for Business Protocols

TheRe Are Two Extensions for the Business Protocol Usage Pattern.

15.1. Variables

This extension clarifies the rules regarding variable initialization in abstract processes. Unlike executable processes, variables in abstract processes do not need to be fully initialized before being used since some computation is left implicit in abstract processes. However, since message properties are meant to represent " transparent, "ie, protocol relevant data, BPEL4WS requires that all message properties in a message must be initialized before the message can be used, for example before the variable of the message is used as the inputVariable in a Web Service operation invocation.

In many cases, the level of abstraction appropriate in abstract processes makes it unnecessary to use message variables in web service interaction activities, when the intent is to simply constrain the sequencing of such activities, and the actual message data is not relevant. To simplify these common cases it is permissible, in abstract processes, to omit the variable reference attributes from the , , and activities. The meaning of such an omission must be stated clearly. If no variable is specified for an incoming message, then the abstract process may not refer subsequently to the message or its properties (if any). If the variable reference is omitted for an outgoing message, then any properties of the message are considered to have been initialized through opaque Assignment, As Described in The Following Section.when Variable Reference 40, Correlation Set Reference, Correlation Set Reference, Correlation As Follows:

For an incoming message which initializes a correlation set (initiator case), the correlation set is deemed to be initialized. For an outgoing message which initializes a correlation set (initiator case), the correlation tokens (which are message properties) are initialized through implicit opaque assignment as described above. for an outgoing message which references but does not initialize a correlation set (follower case), the proper initialization of the message properties is implicit. In this case, the already initialized correlation set itself provides the token values ​​for the Outgoing message.

Note that it is not possible to mix the variable-using and variable-less web service interaction styles freely. If a correlation set is initialized by rule 1 or 2 above, then outgoing messages in the same correlated exchange must also refrain from referencing a message Variable. This is not possible to initialize the profment of the outgoing message from the correlation set alone.15.2. assignment

In External Protocol Behavior.

Abstract Processes Add A Six From-Spec Variant to Allow An Opaque Value To Be Assigned Based on Non-Deterministic Choice, Yielding The Form:

The value of this form in the interpretation of assignment is chosen nondeterministically from the XSD value space of the target. It can only be used in assignments where the "to-spec" refers to a variable property. Two distinct use cases exist for opaque assignment . If the value space of the target is suitably constrained, then opaque assignment is a useful way to describe behavioral alternatives where the mechanism for choosing the alternative is private or otherwise external to the process specification. for this use case, the XSD type of the Target Property Must Be One of the Following:

xsd: boolean A type derived from xsd: string and restricted by enumeration A type derived from any XSD integral numeric type restricted by either enumeration or a combination of minExclusive or minInclusive and maxExclusive or maxInclusive

A second use cases exists for target properties which do not meet these requirements. When the target's value space is not constrained, it is useful to think of opaque assignment as providing a unique identifier. Semantically, each opaque assignment of this form should be considered to generate a unique value similar to a GUID. This style of opaque assignment is most useful to model the initialization of properties used for correlation.A process that uses assignment of opaque values ​​is clearly not executable in the normal sense. However, it is feasible To emulate.

16. EXAMPLES

16.1. Shipping Service

This example presents the use of a BPEL4WS abstract process to describe a rudimentary shipping service This service handles the shipment of orders From the service point of view, orders are composed of a number of items The shipping service offers two types of shipment...: SHIPMENTS WHERE THE ITEMIPPED WHERE The Items Are Shipped Piecemeal Until All of the Order IS Accountted for.

16.1.1. Service Description

The context for the shipping service is a two-party interaction between a tourler and the service. This is modided in The Following PartnerLinkType Definition:

XMLns: PLNK = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/">

The Corresponding Message and Porttype Definitions Are As Follows:

Targetnamespace = "http://ship.org/wsdl/shipping"

XMLns: ship = ...>

"SHIPPINGSERVICEPT">

16.1.2. Message Properties

The Properties Release Relevant to The Service Behavior Are:

The ship order ID that is used to correlate the ship notice (s) with the ship order (shipOrderID) Whether the order is to be shipped complete or not (shipComplete) The total number of items in the order (itemsTotal) The number of items Referred to in a Ship Notice So That

Here Are The Definitions for the Properties and Their Aliases:

Targetnamespace = "http://example.com/shipprops/"

XMLns: SNS = "http://ship.org/wsdl/shipping"

Xmlns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/">

MessageType = "SNS: ShippingRequestmsg"

Part = "shiporder"

Query = "/ shiporderRequestHeader / ShiporderID" />

MessageType = "SNS: ShippingNoticemsg"

Part = "shipnotice"

Query = "/ shipnoticeHeader / ShiporderID" />

MessageType = "SNS: ShippingRequestmsg"

Part = "shiporder"

Query = "/ shiporderRequestHeader / ShipComplete" />

MessageType = "SNS: ShippingRequestmsg"

Part = "shiporder"

Query = "/ shiporderRequestHeader / itemstotal" />

Part = "shipnotice"

Query = "/ shipnoticeHeader / itemscount" />

16.1.3. Process

Next is the process definition For brevity, the abstract process definition does not include, for example, the handling of error conditions (business or otherwise) that a complete description would account for The rough outline of the process is as follows..:

Receive Shiporder

Switch

Case ShipComplete

Send ShipNotice

Otherwise

ItemsShipped: = 0

While ItemsShipped

itemscount: = opaque // Non-Deterministic Assignment

// Corresponding E.g. To

// INTERNAL INTERACTION with

// back-end system

Send ShipNotice

ItemsShipped = ItemsShipped itemscount

And Here Is The More Complete Version:

Targetnamespace = "http://acme.com/shipping"

Xmlns = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns: wsdl = "http://schemas.xmlsoap.org/wsdl/"

XMLns: SNS = "http://ship.org/wsdl/shipping"

XMLns: props = "http://example.com/shipprops/"

AbstractProcess = "YES">

PartnerLinkType = "SNS: Shippinglt"

Partnerrole = "ShippingServiceCustomer"

Myrole = "shippingservice" />

MessageType = "SNS: ShippingRequestmsg" />

MessageType = "SNS: ShippingNoticemsg" />

Properties = "Props: ShiporderID" />

PortType = "SNS: ShippingServicept"

Operation = "ShippingRequest"

Variable = "ShipRequest">

BPWS: GetVariableProperty ('ShipRequest', 'Props: ShipComplete') ">

PortType = "SNS: ShippingServiceCustomerpt"

Operation = "shippingnotice"

InputVariable = "ShipNotice">

BPWS: GetVariableData ('ItemsShipped') <

BPWS: GetVariableProperty ('ShipRequest', 'PROPS: ItemStotal') ">

PortType = "SNS: ShippingServiceCustomerpt"

Operation = "shippingnotice"

InputVariable = "ShipNotice">

"BPWS: GetVariableData ('ItemsShipped')

BPWS: GetVariableProperty ('ShipNotice ",

'Props: itemscount') "/>

16.2. Loan Approval

This example considers a simple loan approval Web Service that provides a port where customers can send their requests for loans. Customers of the service send their loan requests, including personal information and amount being requested. Using this information, the loan service runs a simple process that results in either a "loan approved" message or a "loan rejected" message. The approval decision can be reached in two different ways, depending on the amount requested and the risk associated with the requester. For low amounts (less than $ 10,000) and low-risk individuals, approval is automatic. For high amounts or medium and high-risk individuals, each credit request needs to be studied in greater detail. Thus, to process each request, the loan service uses the functionality provided by two other services In The Streamlined Processing Available for Low-Amount Loans, A "Risk Assessment" Service IS Used to Obtain A Quick Evaluation of the Risk Associated with the Requesting Individua l. A full-fledged "loan approval" service (possibly requiring direct involvement of a loan expert) is used to obtain in-depth assessments of requests when the streamlined approval process does not apply.16.2.1. Service Description

The WSDL portType supported by this service is shown below ( "loanServicePT" portType). It is assumed that an independent "loan.org" consortium has provided definitions of the loan service portType as well as the risk assessment and in-depth loan approval service , so all the required WSDL definitions appear in the same WSDL document. in particular, the portTypes for the Web Services providing the risk assessment and approval functions, and all the required partner link types that relate to the use of these portTypes, are also defined There.

Targetnamespace = "http://loans.org/wsdl/loan-approval"

XMLns = "http://schemas.xmlsoap.org/wsdl/"

XMLns: xsd = "http://www.w3.org/2001/xmlschema"

XMLns: PLNK = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/"

XMLns: lns = "http://loans.org/wsdl/loan-approval">

Message = "lns: errorMessage" />

Message = "lns: errorMessage" />

Message = "lns: errorMessage" />

16.2.2. Process

In the business process defined below, the interaction with the customer is represented by the initial and the matching activities. The use of risk assessment and loan approval services is represented by elements. All these activities are contained within a , and their (potentially concurrent) behavior is staged according to the dependencies expressed by corresponding elements. Note that the transition conditions attached to the elements of the links determine which links get activated. Dead path elimination is enabled by the value "yes" taken by the "suppressJoinFailure" attribute on the element. This implies that as certain links are set false the consequences of this decision can be propagated and the excecution of certain activities can be skipped. Because the Of Type "LoanProcessFault", a fault handler is provided .hen a fault occurs, control is transferted to the fault handler, where .

TargetNamespace = "http://acme.com/loanprocessing"

Xmlns = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns: lns = "http://loans.org/wsdl/loan-approval"

SuppressJoinFail = "YES">

PartnerLinkType = "lns: loanpartnerlinktype"

Myrole = "loanservice" />

PartnerLinkType = "lns: loanapprovallinktype"

Partnerrole = "Approver" />

PartnerLinkType = "lns: riskassessmentmentLinkType"

Partnerrole = "assessors" />

MessageType = "lns: creditinformationMAGESSAGE" />

MessageType = "lns: riskassessmentMessage" />

MessageType = "lns: approalmessage" />

MessageType = "LNS: ErrorMessage" />

Faultvariable = "Error">

PortType = "lns: loanservicept"

Operation = "request"

Variable = "error"

FaultName = "UnableToHandleRequest" />

PortType = "lns: loanservicept"

Operation = "request"

Variable = "Request" createInstance = "yes">

TransitionCondition =

BPWS: GetVariableData ('Request', 'Amount') <10000 "/>

BPWS: GetVariableData ('Request', 'Amount')> = 10000 "/>

PortType = "lns: riskassessment"

Operation = "check"

InputVariable = "request"

Outputvariable = "risk">

TransitionCondition =

"BPWS: getVariableData ('Risk', 'Level') = 'Low'" />

TransitionCondition =

"BPWS: getVariableData ('Risk', 'Level')! = 'Low' />

PortType = "lns: loanapprovalpt"

Operation = "approve"

InputVariable = "request"

Outputvariable = "Approval">

PortType = "lns: loanservicept"

Operation = "request"

Variable = "Approval">

16.3. Multiple Start Activities

A process can have multiple activities that create a process instance. An example of this situation is a (simplified) business process run by an auction house. The purpose of the business process is to collect information from the buyer and the seller of a particular auction , report the appropriate auction results to some auction registration service, and then send the registration result back to the seller and the buyer. Thus the business process starts with two activities, one for receiving the seller information and one for receiving the buyer information. Because a particular auction is uniquely identified by an auction ID, the seller and the buyer need to provide this information when sending in their data. The sequence in which the seller and buyer requests arrive at the auction house is random. Thus, when such a request Comes in, IT Needs to Be Checked WHETHER A Business Process Instance EXISTS ALREADY ORE NOT. IF NOT, A Business Process Instance Is Created. After Both Requests H ave been received, the auction registration service is invoked. Because the invocation is done asynchronously, the auction house passes the auction ID to the auction registration service. The auction registration service returns this auction ID in its answer so that the auction house can locate the proper business process instance. Because there are many buyers and sellers, each of them needs to provide their endpoint references, so that the auction service can respond properly. In addition, the auction house needs to provide its own endpoint reference to the auction registration service SO That The Auction Registration Service CAN Send The Response Back to The Auction House.16.3.1. Service Description

The auction service offers two port types, called sellerPT and buyerPT, with appropriate operations for accepting the data provided by the seller and the buyer. Because the processing time of the business process is lengthy, the auction service responds to the seller and buyer through appropriate port types, sellerAnswerPT and buyerAnswerPT. These portTypes are properly combined into two partner link types, one for the seller called sellerAuctionHouseLT and one for the buyer called buyerAuctionHouseLT.The auction service needs two port types, called auctionRegistrationPT and auctionRegistrationAnswerPT, that provide for the invocation Of The Auction Registration Service. The Port Types Are Part of The Appropriate Partner Link Type AuctionhouseAuctionRegistrationServiceLodelt.

Targetnamespace = "http://www.auction.com/wsdl/auctionservice"

XMLns: TNS = "http://www.auction.com/wsdl/auctionservice"

XMLns: PLNK = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/"

XMLns: wsa = "http://schemas.xmlsoap.org/ws/2003/03/address"

XMLns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns: xsd = "http://www.w3.org/2001/xmlschema"

XMLns = "http://schemas.xmlsoap.org/wsdl/">

TYPE = "WSA: EndPointReference" />

TYPE = "xsd: string" />

MessageType = "TNS: SELLERDATA"

Part = "AuctionID" />

MessageType = "TNS: BuyerData"

Part = "id" />

MessageType = "TNS: AUCTIONDATA"

Part = "AuctionID" />

MessageType = "TNS: Auctionanswerdata"

Part = "AuctionID" />

Registration service ->

16.3.2. Process

The bpel4ws definition for the business process offering by the an Auction House Follows:

Targetnamespace = "http://www.auction.com"

VariableAccessSerializable = "no"

XMLns: as = "http://www.auction.com/wsdl/auctionservice"

XMLns: wsa = "http://schemas.xmlsoap.org/ws/2003/03/address"

XMLns = "http://schemas.xmlsoap.org/ws/2003/03/business-process/">

PartnerLinkType = "as: sellerauctionHouselt"

Myrole = "Auctionhouse" partnerrole = "SELLER" />

PartnerLinkType = "as: BuyerauctionHouselt"

Myrole = "AuctionHouse" partnerrole = "buyer" />

PartnerLinkType =

"AS: AUCTIONHOUSEAUCTIONREGISTRATIONSERVICELT"

Myrole = "Auctionhouse"

Partnerrole = "AuctionRegistrationService" />

MessageType = "as: auctiondata" />

MessageType = "as: auctionanswerdata" />

AS Well as Auction House and Auction Registration Service

Exchange ->

Properties = "as: auctionid" />

PartnerLink = "SELLER"

PortType = "as: sellerpt"

Operation = "provide"

Variable = "SellerData"

CreateInstance = "YES">

INITIATE = "YES" />

PartnerLink = "buyer"

PortType = "as: buyerpt"

Operation = "provide"

Variable = "BuyerData"

CreateInstance = "YES">

INITIATE = "YES" />

By Setting The Target Endpoint Reference

And Setting My OWN Endpoint Reference for Call Back

And Receiving The Answer

Correlation of Request and answer is via auction ID ->

XS: Anyuri

ARS: RegistrationService

EndpointReference = "myrole" />

Part = "AuctionHouseServiceRef" />

PartnerLink = "AUCTIONREGISTRATIONSERVICE"

Porttype = "as: an AUCTIONREGISTRATIONPT"

Operation = "process"

InputVariable = "AuctionData">

PartnerLink = "AUCTIONREGISTRATIONSERVICE"

PortType = "as: auctionregistrationanswerpt"

Operation = "Answer"

Variable = "AuctionansWerdata">

Setting the solder to the endpoint reference provided by the Seller

And Invoking The Response ->

Part = "endpointReference" />

PartnerLink = "SELLER"

PortType = "as: selleranswerpt"

Operation = "Answer"

InputVariable = "selleranswerdata" />

Setting the buyer to the endpoint reference provided by The Buyer

And Invoking The Response ->

Part = "endpointReference" />

PartnerLink = "buyer"

Porttype = "as: buyeranswerpt"

Operation = "Answer"

InputVariable = "BuyeranswerData" />

17. Security Considances

Because messages can be modified or forged, it is strongly RECOMMENDED that business process implementations use WS-Security to ensure messages have not been modified or forged while in transit or while residing at destinations. Similarly, invalid or expired messages could be re-used or message headers not specifically associated with the specific message could be referenced. Consequently, when using WS-Security, signatures MUST include the semantically significant headers and the message body (as well as any other relevant data) so that they can not be independently separated and re -USED.

Messaging protocols used to communicate among business processes are subject to various forms of replay attacks. In addition to the mechanisms listed above, messages SHOULD include a message timestamp (as described in WS-Security) within the signature. Recipients can use the timestamp information to .

It should also be noted that business process implementations are subject to various forms of denial-of-service attacks. Implementers of business process execution systems compliant with this specification should take this into account.

18. ACKNOWLEDGMENTS

Achille Fokoue, Ashok Malhotra, and Bob Schloss for the xml Schemas.tony Andrews and Marc Levy for Their Help in Defining Abstract Processes.

Tony Hoare And Marc Shapiro for Thoughtful Comments on The Language Concepts.

Languages.

Tom Freund and Tony Storey for Inducing Us Precisely Define The Relationship IN WS-Transaction.

Martin Nally for His Help on Improving The USAbility of The Language.

19. References

REC-XML

W3C Recommendation "The XML Specification"

SOAP

W3C Note "Simple Object Access Protocol (SOAP) 1.1"

WSDL

W3C Note "Web Services Definition Language (WSDL) 1.1"

UDDI

Industry Initiative "Universal Description, Discovery and Integration"

Xlang

Web Services for Business Process Design

WSFL

WSFL: Web Service Flow Language 1.0

XML Schema 1

W3c proposed Recommendation "XML Schema Part 1: Structure"

XML Schema 2

W3c proposed Recommendation "XML Schema Part 2: DataTypes"

XPath

W3C Recommendation "XML Path Language (XPath) Version 1.0"

Sagas

"Sagas", H. Garcia-Molina And K. Salem, Proc. ACM Sigmod (1987).

Open Nested Transactions

"Trends in Systems Aspects of Database Management", I.L. Traiger, Proc. 2nd Intl. Conf. On Databases (ICOD-2), Wiley & Sons 1983.

WS-Transaction

Web Services Transaction, IBM & Microsoft, 2002.

Keywords

"Key Words for Use in RFCS to Indicate Requirement Levels",

RFC 2119

, S. Bradner, Harvard University, March 1997.

URI

"Uniform Resource Identifiers (URI): Generic Syntax,

RFC 2396, T. Berners-Lee, R. Fielding, L. Masinter, MIT / LCS, U.ARVINE, XEROX CORPORATION, AUGUST 1998.

BPEL

"Business Process Execution Language for Web Services Version 1.0," BEA, IBM and Microsoft, August 2002:

http://dev2dev.bea.com/techtrack/bpel4ws.jsp/bpel4ws.jsp

,

http://www-106.ibm.com/developerworks/library/ws-bpel/

,

http://msdn.microsoft.com/library/en-us/dnbiz2k2/html/bpel1-0.asp

WS-Addressing

Web Services Addressing (WS-Addressing ", BEA, IBM and Microsoft, March 2003:

http://msdn.microsoft.com/ws/2003/03/ws-addressing/

,

http://www-106.ibm.com/developerWorks/webservices/library/ws-add/

,

Http://dev2dev.bea.com/technologies/webservices/ws-addressing.jsp

20. Appendices

20.1. Appendix A - Standard Faults

. The following list specifies the standard faults defined within the BPEL4WS specification All these faults are named within the BPEL4WS namespace standard prefix bpws: corresponding to URI "http://schemas.xmlsoap.org/ws/2003/03/business-process/ ".

Fault nameReasonselectionFailureThrown when a selection operation performed either in a function such as bpws: getVariableData, or in an assignment, encounters an error.conflictingReceiveThrown when more than one receive activity or equivalent (currently, onMessage branch in a pick activity) are enabled simultaneously for the same partner link, port type, operation and correlation set (s) .conflictingRequestThrown when more than one synchronous inbound request on the same partner link for a particular port type, operation and correlation set (s) are active.mismatchedAssignmentFailureThrown when incompatible types are encountered in an assign activity.joinFailureThrown when the join condition of an activity evaluates to false.forcedTerminationThrown as the result of a fault in an enclosing scope.correlationViolationThrown when the contents of the messages that are processed in an invoke, receive, or reply activity do not Match specified correlation information .uninitialized correlation information .uninitialized zariablethrown wh en there is an attempt to access the value of an uninitialized part in a message variable.repeatedCompensationThrown when an installed compensation handler is invoked more than once.invalidReplyThrown when a reply is sent on a partner link, portType and operation for which the corresponding receive with The Same Correlation Has Not Been Carried Out.p {Font-Family: Sans-Serif;

20.2. Appendix A - Standard Faults

The following list specifies the defaults for all standard attributes at the process and activity level. The table does not include activity-specific attributes (such as partnerLink in an invoke activity).

ParameterDefaultqueryLanguagehttp: //www.w3.org/TR/1999/REC-xpath-19991116 expressionLanguagehttp: //www.w3.org/TR/1999/REC-xpath-19991116 suppressJoinFailurenovariableAccessSerializablenoabstractProcessnoinitiatenopatternNo defaultcreateInstancenoenableInstanceCompensationnojoinConditionDisjunction of the status of the incoming linkstransitionConditiontruep {font- Family: sans-serif;}

20.3. Appendix C - Coordination Protocol

It is valuable to express the fault and compensation handling relationship between scopes by using the protocol framework of [WS-Addressing]. Specifically, this section shows how the relationship between an enclosing scope and each of its nested scopes can be modeled using the BusinessAgreement protocol defined in the WS-Transaction specification. The BusinessAgreement protocol is designed to enable distributed coordination of business activities. BPEL4WS usage of the protocol makes the assumption of localized behavior in a single service, and as a result several of the features of the protocol, including ............. ..

20.3.1. Coordination Protocol for BPEL4WS Scopes

A. A nested scope may complete successfully. In this case a compensation handler is installed for the nested scope. This is modeled with a Completed signal from the nested scope to its parent scope. B. A nested scope may encounter a fault internally. In This Case The Scope Always Terminates UnsuccessFully.

i. If the fault handler rethrows a fault to its enclosing scope, this is modeled as a Faulted signal from the nested scope to its parent scope. ii. If the fault is handled and not rethrown, the scope exits gracefully from the work of its parent scope. This is modeled as an Exited signal from the nested scope to its parent scope. C. After a nested scope has completed, (a fault or compensation handler for) the parent scope may ask it to compensate itself by invoking its compensation handler . The compensate action is modeled with a Compensate signal from the parent scope to the nested scope. D. Upon successful completion of the compensation, the nested scope sends the Compensated signal to its parent scope. E. The compensation handler may itself fault internally. In this case

i. If the fault is not handled by a scope within the compensation handler, it is rethrown to the parent scope. This is modeled as a Faulted signal from the nested scope to its parent scope. ii. If the fault is handled and not rethrown , we assume that the compensation was able to complete successfully. in this case the nested scope sends the Compensated signal to its parent scope. F. If there is a fault in the parent scope independent of the work of the nested scope, the parent scope will ask the nested scope to prematurely abandon its work by sending a Cancel signal. G. The nested scope, upon receiving the cancel signal, will interrupt and terminate its behavior (as though there were an internal fault), and return a Canceled signal to the parent. H. Finally, when a parent scope decides that the compensation for a completed nested scope is not needed any more it sends a Close signal to the nested scope. After discarding the compensation handler the nested scope responds with a C losed signal. I. In case there is a race between the Completed signal from the nested scope and the Cancel signal from the parent scope, the Completed signal wins, ie, the nested scope is deemed to have completed and the Cancel signal is ignored. J. In case a Cancel signal is sent to a nested scope that has already faulted internally, the Cancel signal is ignored and the scope will eventually send either a Faulted or an Exited signal to the parent.Figure 2: BusinessAgreement Protocol State Diagram

The BusinessAgreement protocol state diagram above summarizes the preceding discussion. In the diagram, the parent (enclosing) scope generates Cancel, Compensate, Forget and Close signals and the nested scope generates Completed, Faulted, Exited, Compensated, Canceled and Closed signals. It is important to emphasize that the states represent the state of the relationship between the parent scope and one specific nested scope. However, it is very nearly the case that the states represent the state of the nested scope itself, except in case of signal races. Note That The Signal Races Discussed in Points I and J Above Are Not Reflected In The Diagram Since The Diagram Only Reflects Real Protocol State.20.4. Appendix D - XSD Schemas

BPEL4WS Schema

XMLns: wsdl = "http://schemas.xmlsoap.org/wsdl/"

XMLns: bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

Targetnamespace = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

ElementFormDefault = "Qualified">

SchemAlocation = "http://schemas.xmlsoap.org/wsdl/" />

THIS TYPE IS Extended by Other Component Types

To Allow Elements and Attributes from

Other namespaces to be added.

ProcessContents = "LAX" />

Minoccurs = "0" />

Minoccurs = "0" />

Type = "bpws: tvariables"

Minoccurs = "0" />

Type = "bpws: tcorrelationsets" minoccurs = "0" />

Minoccurs = "0" />

Type = "bpws: tcompensationhandler" minoccurs = "0" />

TYPE = "bpws: teventhandlers" minoccurs = "0" />

Use = "required" />

Use = "required" />

Default = "http://www.w3.org/TR/1999/Rec-xpath-19991116" />

Default = "http://www.w3.org/TR/1999/Rec-xpath-19991116" />

TYPE = "bpws: tboolean" default = "no" />

DEFAULT = "no" />

Use = "required" />

Minoccurs = "1" maxoccurs = "unbounded" />

Maxoccurs = "unbounded">

Use = "required" />

Minoccurs = "0" maxoccurs = "unbounded" />

Minoccurs = "0" />

Minoccurs = "0" maxoccurs = "unbounded" />

Minoccurs = "0" maxoccurs = "unbounded" />

Minoccurs = "0" />

Use = "optional" />

TYPE = "BPWS: TVARIABLE"

Maxoccurs = "unbounded" />

Because OtherWise ITS Content Model Would Be Non-Deterministic ->

TYPE = "BPWS: TcorrelationSet"

Maxoccurs = "unbounded" />

"Required">

Minoccurs = "0" maxoccurs = "unbounded" />

Minoccurs = "0" maxoccurs = "unbounded" />

TYPE = "BPWS: TBOOLEAN-EXPR" />

TYPE = "bpws: tboolean" default = "no" />

TYPE = "BPWS: TBOOLEAN-EXPR" />

Minoccurs = "1" maxoccurs = "unbounded" />

DEFAULT = "no" />

TYPE = "BPWS: TcorrelationwithPattern"

Minoccurs = "1"

Maxoccurs = "unbounded" />

Type = "bpws: tcorrelationswithpattern"

Minoccurs = "0" maxoccurs = "1" />

Minoccurs = "0" maxoccurs = "unbounded" />

TYPE = "BPWS: TACTIVITYORCOMPENSATECONTAINER"

Minoccurs = "0" />

Type = "bpws: tcompensationhandler" minoccurs = "0" />

TYPE = "ncname" use = "optional" />

Use = "optional" />

Type = "bpws: tcorrelations" minoccurs = "0" />

DEFAULT = "no" />

Type = "bpws: tcorrelations" minoccurs = "0" />

Use = "optional" />

Minoccurs = "1" maxoccurs = "unbounded" />

Use = "prohibited" />

Use = "prohibited" />

TYPE = "BPWS: TDURATION-EXPR" />

TYPE = "BPWS: TDEADLINE-EXPR" />

TYPE = "BPWS: TLINK"

Maxoccurs = "unbounded" />

TYPE = "BPWS: TBOOLEAN-EXPR"

Use = "required" />

TYPE = "BPWS: TAACTIVITYCONTAINER"

Minoccurs = "0" />

Use = "required" />

TYPE = "BPWS: TonMessage"

Maxoccurs = "unbounded" />

TYPE = "bpws: Tonalarm" minoccurs = "0"

Maxoccurs = "unbounded" />

TYPE = "bpws: tboolean" default = "no" />

Type = "bpws: tvariables"

Minoccurs = "0" />

TYPE = "BPWS: Tcorrelationset"

Minoccurs = "0" />

TYPE = "BPWS: TFAULTHANDLERS"

Minoccurs = "0" />

TYPE = "BPWS: TcompensationHandler"

Minoccurs = "0" />

Minoccurs = "0" />

TYPE = "BPWS: TBOOLEAN"

DEFAULT = "no" />

Partner Link Type Schema

XMLns: PLNK = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/"

Targetnamespace = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/"

ElementFormDefault = "Qualified">

Message Properties Schema

Targetnamespace = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

XMLns: wsbp = "http://schemas.xmlsoap.org/ws/2003/03/business-process/"

ElementFormDefault = "Qualified">

转载请注明原文地址:https://www.9cbs.com/read-10443.html

New Post(0)