How to Use bpelx:append

Manipulating XML Data in a BPEL Process 6-25 bpelx:insertBefore bpel:assign The from-spec query within bpelx:insertBefore yields zero or more nodes. The node list is appended as child nodes to the target node specified by the to-spec query. The to-spec query of the insertBefore operation points to one or more single L-Value nodes. If multiple nodes are returned, the first node is used as the reference node. The reference node must be an element node. The parent of the reference node must also be an element node. Otherwise, a bpel:selectionFailure fault is generated. The node list generated by the from-spec query selection is inserted before the reference node. The to-spec query cannot refer to a partner link. Example 6–44 shows the syntax before the execution of insertBefore. The value of addrVar is: Example 6–44 Presyntax Execution a:usAddress a:stateCAa:state a:zipcode94065a:zipcode a:usAddress Example 6–45 shows the syntax after the execution: Example 6–45 Postsyntax Execution bpel:assign bpelx:insertBefore bpelx:from a:cityRedwood Shorea:city bpelx:from bpelx:to addrVar query=a:usAddressa:state bpelx:insertBefore bpel:assign Example 6–46 shows the value of addrVar: Example 6–46 addrVar Value a:usAddress a:cityRedwood Shorea:city a:stateCAa:state a:zipcode94065a:zipcode a:usAddress

6.14.2.2 bpelx:insertBefore in BPEL 2.0

Example 6–47 provides an example of bpelx:insertBefore syntax in a BPEL project that supports BPEL version 2.0. In BPEL 2.0, the functionality is the same as described in Section 6.14.2.1, bpelx:insertBefore in BPEL 1.1, but the syntax is slightly different. An extensionAssignOperation element wraps the bpelx:insertBefore extension. Example 6–47 bpelx:insertBefore Extension in BPEL 2.0 assign extensionAssignOperation bpelx:insertBefore 6-26 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite bpelx:from bpelx:literal a:cityRedwood Shorea:city bpelx:literal bpelx:from bpelx:toaddrVara:statebpelx:to bpelx:insertBefore extensionAssignOperation assign

6.14.3 How to Use bpelx:insertAfter

The bpelx:insertAfter extension in an assign activity enables a BPEL process service component to insert the contents of one variable, expression, or XML fragment after another variable’s contents. To use this extension, you select a copy rule at the bottom of the Copy Rules tab, then select InsertAfter from the dropdown list, as shown in Figure 6–6 .

6.14.3.1 bpelx:insertAfter in BPEL 1.1

Example 6–48 provides an example of bpelx:insertAfter in a BPEL project that supports BPEL version 1.1. Example 6–48 bpelx:insertAfter Extension in BPEL 1.1 bpel:assign bpelx:insertAfter bpelx:from ... bpelx:to ... bpelx:insertAfter bpel:assign This operation is similar to the functionality described for Section 6.14.2, How to Use bpelx:insertBefore, except for the following: ■ If multiple L-Value nodes are returned by the to-spec query, the last node is used as the reference node. ■ Instead of inserting nodes before the reference node, the source nodes are inserted after the reference node. This operation can also be considered a macro of conditional-switch + append or insertBefore. Example 6–49 shows the syntax before the execution of insertAfter. The value of addrVar is: Example 6–49 Presyntax Execution a:usAddress a:addressLine500 Oracle Parkwaya:addressLine a:stateCAa:state a:zipcode94065a:zipcode a:usAddress Note: The bpelx:insertAfter extension works with SDO variables, but the target must be the variable attribute into which the copied data must go.