BPEL Syntax Reference

This appendix provides a syntax reference for the Web Services Business Process Execution Language (WS-BPEL) version 2.0, OASIS Standard as defined in the specification dated April 11, 2007 available the following URLs:

‹‹ http://docs.oasis-open.org/wsbpel/2.0/wsbpel-v2.0.html

‹‹ http://docs.oasis-open.org/wsbpel/2.0/wsbpel-v2.0.doc

‹‹ http://docs.oasis-open.org/wsbpel/2.0/wsbpel-v2.0.pdf

Important BPEL activities and elements The following section covers important activity and element tags associated with BPEL processing.

, , , and The activity is used to do the following:

‹‹ Copy data from one variable to another

‹‹ Construct and insert new data using expressions and literal values

‹‹ Copy partner endpoint references

The syntax is as follows:

standard-elements ( from-spec to-spec BPEL Syntax Reference

| assign-element-of-other-namespace )+

The from-spec section can have the following forms:

? queryContent expression literal value

The to-spec section can have the following forms:

? queryContent expression

and The activityis specified within fault handlers to specify faults that are to be caught and handled. The activity is used to catch all faults. Within a fault handler, at least one activity needs to be specified. The optional activity can also be specified. In the designer mode it is displayed in the right-hand side of the BPEL process.

The activity has four attributes that can be used to specify fault to handle (at least one of them needs to be specified):

‹‹ faultName: This specifies the name of the fault to be handled

‹‹ faultVariable: This specifies the variable used for fault data

[ 352 ] Appendix B

‹‹ faultMessageType: This specifies the message type used for fault data

‹‹ faultElement: This specifies the element used for fault data The syntax is as follows:

? * activity ? activity

To start compensation on all inner scopes that have already completed successfully, in default order, you use the activity. We can use this activity from within a fault handler, another compensation handler, or a termination handler only.

The syntax is as follows:

standard-elements

To start compensation on a specified inner scope that has already completed successfully, you use the activity. The activity has an optional target attribute that is used to specify the scope to be compensated. We can use this activity from within a fault handler, another compensation handler, or a termination handler only.

The syntax is as follows:

standard-elements

[ 353 ] BPEL Syntax Reference Compensation handlers are used to define compensation activities. Compensation handlers gather all activities that have to be carried out to compensate another activity and can be defined for the whole process or scope, or can be inline for the activity. The syntax is as follows:

activity

and The element is used to associate a correlation set (a collection of keydata fields) with an activity. Correlation can be used within the , , , , and activities. The syntax is as follows:

? +

and A correlation set is a set of properties shared by messages and used for correlation. It is used to associate a message with a business process instance. It is used primarily in asynchronous invocations. Each correlation set has a name attribute. The syntax is as follows:

? +

An activity that does nothing is defined by the tag. Another use of is to provide a synchronization point in . The syntax is as follows:

standard-elements

[ 354 ] Appendix B Event handlers react to events that occur while the business process is executing. When these events occur, the corresponding event handlers are invoked. Event handlers can be specified for the whole process as well as for each scope.

The syntax is as follows:

? * ? + ? + ... * ( duration- | deadline-expr )? duration-expr ? ...

The activity is used to immediately end a business process instance. The syntax is as follows:

standard-elements

[ 355 ] BPEL Syntax Reference and Fault handlers are used to react to faults that occur while the business process activities are executing. They can be specified for the global process or each scope, or inline for activities. Multiple activities can be specified within the fault handler for specific faults. You need to specify at least one activity. You can optionally specify the activity. The syntax and functionality of the activity is the same as that described in the earlier section on and . In the JDeveloper design view, the fault handlers are shown on the right-hand side of the process flow.

The syntax is as follows:

? * activity ? activity

The activity provides concurrent execution of enclosed activities and their synchronization.

The syntax is as follows:

standard-elements ? + activity+

A activity iterates its child scope activity exactly N+1 times whereN equals the minus the value. The branches can execute in parallel, if parallel="yes". A tag may be used within to allow the activity to complete without executing or finishing all the branches specified.

[ 356 ] Appendix B

The syntax is as follows:

standard-elements unsigned-integer-expression unsigned-integer-expression ? ? unsigned-integer-expression ...

and The activity is used to specify how to store the different message parts to BPEL variables. We can specify in the following BPEL activities that receive messages:

‹‹

‹‹ (within )

‹‹ (within )

‹‹ (for receiving the response in request/response operations) The syntax is as follows:

? +

, , and To express conditional behavior, the activity is used. It consists of one or conditional branches defined by elements, followed by an optional element.

[ 357 ] BPEL Syntax Reference

The syntax is as follows:

standard-elements bool-expr activity * bool-expr activity ? activity

The activity is used within a BPEL process to declare a dependency on external XML Schema or WSDL definitions. Any number of the elements may appear as children of the element. The syntax is as follows:

*

The activity is used to invoke the service operations provided by partner links. The syntax is as follows:

standard-elements ? +

[ 358 ] Appendix B

faultElement="QName"?>* activity ? activity ? activity ? + ? +

and Synchronization dependencies in concurrent flows are specified using . The syntax is as follows:

? +

and The is used to associate an outbound message activity ( ) with an inbound message activity ( , , or ). The syntax is as follows:

? +

The activityis used in the and activities to specify the occurrence of alarm events.

[ 359 ] BPEL Syntax Reference

The syntax in the activity is as follows:

* ( duration-expr | deadline-expr ) activity

The syntax in the activity is as follows:

* ( duration-expr | deadline-expr )? duration-expr ? ...

The is used in the activities to specify the occurrence of message events.

The syntax is as follows:

* ? + ? + ...

[ 360 ] Appendix B This activity is used in the activity to specify the occurrence of message events. The syntax is as follows:

+ ? + ? + activity

and A business process interacts with services that are modeled as partner links. Each partner link is characterized by . More than one partner link can be characterized by the same . See the next section for more on . The syntax is as follows:

? +

and A partner link type characterizes the relationship between two services. It defines roles for each of the services in the conversation between themand specifies the port type provided by each service to receive messages. Partner link types and roles are specified in the WSDL.

[ 361 ] BPEL Syntax Reference

The syntax is as follows:

... ? ...

The activity is used to wait for the occurrence of one of a set of events and then perform an activity associated with the event.

The syntax is as follows:

standard-elements + ? + ? + activity * ( duration-expr | deadline-expr ) activity

[ 362 ] Appendix B The root element of each BPEL process definition is . For an explanation, please refer to Chapter 1, Hello BPEL.

The syntax is as follows:

? +

*

? +

? +

? + from-spec?

? +

[ 363 ] BPEL Syntax Reference

? * activity ? activity

? * ? + ? + ... * ( duration-expr | deadline-expr )? duration-expr ? ... activity

[ 364 ] Appendix B Properties are used to create globally unique names and associate them with data types (XML Schema types). Properties havegreater significance than the types themselves. Properties are defined in WSDL.

The syntax is as follows:

...

Property aliases are used to map global properties to fields in specific message parts. Property aliases are defined in the WSDL.

The syntax is as follows:

? queryContent ...

A activity is used to receive requests in a BPEL business process to provide services to its partners.

The syntax is as follows:

[ 365 ] BPEL Syntax Reference

messageExchange="NCName"? standard-attributes> standard-elements ? + ? +

A activity is used to define an iterative activity. The iterative activity is repeated until the specified becomes true. The is tested after the child activity completes. The activity is used to execute the child activity at least once.

The syntax is as follows:

standard-elements activity bool-expr

A activityis used to send a response to a request previously accepted through a activity. Responses are used for synchronous request/reply interactions. An asynchronous response is always sent by invoking the corresponding one-way operation on the partner link.

The syntax is as follows:

standard-elements ? +

[ 366 ] Appendix B

? +

The activity is used to rethrow the fault that was originally caught by the immediately enclosing fault handler.

The syntax is as follows:

standard-elements

Scopes define behavior contexts for activities. They provide local partner links, message exchanges, variables, correlation sets, fault handlers, compensation handlers, termination handlers, and event handlers for activities.

The syntax is as follows:

standard-elements ? ... see above under for syntax ... ? ... see above under for syntax ... ? ... see above under for syntax ... ? ... see above under for syntax ... ? ... see above under for syntax ... ? ...

[ 367 ] BPEL Syntax Reference

? ... ? ... see above under for syntax ... activity

A activity is used to define activities that need to be performed in a sequential order.

The syntax is as follows:

standard-elements activity+

and The elements are used to declare that an activity is the source of one or more links. This is a standard element.

The syntax is as follows:

? + ? bool-expr

and The element is used to declare that an activity is the target of one or more links. This is a standard element.

The syntax is as follows:

? ? bool-expr

[ 368 ] Appendix B

+

The element provides the ability for scopes to control the semantics of forced termination to some degree. This element can be declared within . The syntax is as follows:

activity

The activity is used to generate a fault from inside the BPEL process. The syntax is as follows:

standard-elements

and The specifies which BPEL variables will map to which message part. The activity is used to specify the mapping of outbound messages. We can specify in the following BPEL activities— and . The syntax is as follows:

? +

[ 369 ] BPEL Syntax Reference The activity is used to ensure that values of variables are valid against their associated XML data definition.

The syntax is as follows:

standard-elements

and Variables are used to hold messages that constitute the state of a business process. The variable may be of the WSDL message type, an XML Schema simple type, or an XML Schema element.

The syntax is as follows:

+ from-spec?

A activity is used to specify a delay for a certain period of or until a certain deadline is reached.

The syntax is as follows:

standard-elements ( duration-expr | deadline-expr )

[ 370 ] Appendix B A activity is used to define an iterative activity. The iterative activity is repeated as long as the specified is true. The syntax is as follows:

standard-elements bool-expr activity

[ 371 ]