Last week, we looked at process lifecycles. This week, we'll take a look at the assign and other basic activities, and study flow. This article, the fourth 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: 0672326418).
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:
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):
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:
This wait activity waits for three days and 10 hours:
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: