Last week, we began taking a look at business processes and their role in constructing web services. This week, we will look at process lifecycles, invoking and providing web services, and more. This article, the third in a series, is excerpted from chapter 12 of Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, written by Steve Graham et al. (Sams; ISBN: 672326418).
Process Lifecycles and Web Services - Data Handling and Related Activities (Page 4 of 4 )
Messages initiate business processes. Processes receive messages from business partners and respond to partners via messages. Every invocation of a Web service that is orchestrated by a process is based on the exchange of messages. All these messages are specified as part of the external interface of the business process, its portTypes.
Looking at the messages from the point of view of the process definition, BPEL provides the construct for variables to store these messages. Variables are used for
Messages that a process receives
Messages that are needed as input for the invocation of Web services operations
The result of service invocations
Intermediate data that the internal business logic might depend on (for example, to compose messages or for conditional logic)
Variables can be typed either by WSDL message types or by XML schema types: WSDL messages types are to be specified for messages that are exchanged with partners. Variables used only for internal data handling can be typed either way.
Variables are scoped. They can be globally declared at the process level. BPEL also supports the notion of variables that are local to a BPEL scope (more details on scopes later). The scope of a variable determines its visibility and lifetime. A variable is visible within the scope it's declared in and also to all nested scopes within that scope.
The purchase order request is an example of a global variable declaration using a message type. Its declaration appears in the variables section of the process:
Please check back next week for the continuation of this article.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.