Flow and Web Services - XPath Extension Functions
(Page 2 of 5 )
Last but not least there is the need to access data from a process not only as part of assignments, but also to control the behavior of a process (for example, in conditions). In order to enable arbitrary XPath expressions to access data from the process, BPEL introduces several XPath extension functions.
The getVariableData function extracts arbitrary values from variables. The partName and locationPath arguments are optional:
getVariableData("variableName", "partName",
"locationPath")
A variable can carry global message properties, the values of which can be extracted using the getVariableProperty function with the qualified name of the global property:
getVariableProperty("variableName",
"propertyQName")
The getLinkStatus function returns a Boolean indicating the status of a link. It can only be applied in join conditions (see the section on links for details):
getLinkStatus("linkName")
The extension functions are useful for all kinds of expressions: in transition conditions, join conditions, while conditions, and switch cases, as well as for duration and deadline expressions.
More Basic Activities: wait, empty
Let's briefly discuss the remaining two basic activities: wait and empty. The wait activity allows the business process to wait for a specific time interval (specified by a duration-valued XPath expression) or until a certain deadline is reached (specified by a deadline-valued XPath expression). The following wait activity waits until New Year's Eve:
<wait until="2004-12-31T18:00+1:00"/>
This wait activity waits for three days and 10 hours:
<wait for="P3DT10H"/>
The empty activity does nothing. It may, for example, be used as implementation of a fault handler if you need to catch and suppress a fault:
<empty/>
Next: Flows >>
More Web Services Articles
More By Sams Publishing
|
This article 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: 0672326418). Check it out today at your favorite bookstore. Buy this book now.
|
|