How to Use 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. Manipulating XML Data in a BPEL Process 6-27 Example 6–50 shows the syntax after the execution: Example 6–50 Postsyntax Execution bpel:assign bpelx:insertAfter bpelx:from a:addressLineMailstop 1op6a:addressLine bpelx:from bpelx:to addrVar query=a:usAddressa:addressLine[1] bpelx:insertAfter bpel:assign Example 6–51 shows the value of addrVar: Example 6–51 addrVar Value a:usAddress a:addressLine500 Oracle Parkwaya:addressLine a:addressLineMailstop 1op6a:addressLine a:stateCAa:state a:zipcode94065a:zipcode a:usAddress The from-spec query within bpelx:insertAfter yields zero or more nodes. The node list is appended as child nodes to the target node specified by the to-spec query.

6.14.3.2 bpelx:insertAfter in BPEL 2.0

Example 6–52 provides an example of bpelx:insertAfter 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.3.1, bpelx:insertAfter in BPEL 1.1, but the syntax is slightly different. An extensionAssignOperation element wraps the bpelx:insertAfter extension. Example 6–52 bpelx:insertAfter Extension in BPEL 2.0 assign extensionAssignOperation bpelx:insertAfter bpelx:from bpelx:literal a:addressLineMailstop 1op6a:addressLine bpelx:literal bpelx:from bpelx:toaddrVara:addressLine[1]bpelx:to bpelx:insertAfter extensionAssignOperation assign

6.14.4 How to Use bpelx:remove

The bpelx:remove extension in an assign activity enables a BPEL process service component to remove a variable. In Oracle BPEL Designer, you add the bpelx:remove extension by dragging the remove icon in the upper right corner of the Copy Rules tab to the target variable you want to remove, and releasing the cursor. Figure 6–8 provides details. 6-28 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 6–8 Remove Icon in Copy Rules Tab of an Assign Activity After releasing the cursor, the bpelx:remove extension is applied to the target variable. Figure 6–9 provides details. Figure 6–9 bpelx:remove Extension Applied to a Target Variable

6.14.4.1 bpelx:remove in BPEL 1.1

Example 6–53 provides an example of bpelx:remove in a BPEL project that supports BPEL version 1.1. Example 6–53 bpelx:remove Extension in BPEL 1.1 bpel:assign bpelx:remove bpelx:target variable=ncname part=ncname? query=xpath_str bpelx:remove bpel:assign Node removal specified by the XPath expression is supported. Nodes specified by the XPath expression can be multiple, but must be L-Values. Nodes being removed from this parent can be text nodes, attribute nodes, and element nodes. The XPath expression can return one or more nodes. If the XPath expression returns zero nodes, then a bpel:selectionFailure fault is generated. The syntax of bpelx:target is similar to and a subset of to-spec for the copy operation. Example 6–54 shows addrVar with the following value: Example 6–54 addrVar a:usAddress a:addressLine500 Oracle Parkwaya:addressLine a:addressLineMailstop 1op6a:addressLine a:stateCAa:state a:zipcode94065a:zipcode a:usAddress After executing the syntax shown in Example 6–55 in the BPEL process service component file, the second address line of Mailstop is removed: