How to Manipulate Attributes

Manipulating XML Data in a BPEL Process 6-23 Figure 6–7 Copy Rule Converted to bpelx Extension in BPEL 2.0 For more information, see the online Help for this dialog and Section A.2.2, Assign Activity.

6.14.1 How to Use bpelx:append

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

6.14.1.1 bpelx:append in BPEL 1.1

Example 6–40 provides an example of bpelx:append in a BPEL project that supports BPEL version 1.1. Example 6–40 bpelx:append Extension in BPEL 1.1 bpel:assign bpelx:append bpelx:from ... bpelx:to ... bpelx:append bpel:assign The from-spec query within bpelx:append yields zero or more nodes. The node list is appended as child nodes to the target node specified by the to-spec query. Note: The bpelx:append extension is not supported with SDO variables and causes an error. 6-24 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite The to-spec query must yield one single L-Value element node. Otherwise, a bpel:selectionFailure fault is generated. The to-spec query cannot refer to a partner link. Example 6–41 consolidates multiple bills of material into one single bill of material BOM by appending multiple b:parts for one BOM to b:parts of the consolidated BOM. Example 6–41 Consolidation of Multiple Bills of Material bpel:assign bpelx:append bpelx:from variable=billOfMaterialVar query=b:bomb:partsb:part bpelx:to variable=consolidatedBillOfMaterialVar query=b:bomb:parts bpelx:append bpel:assign

6.14.1.2 bpelx:append in BPEL 2.0

Example 6–42 provides an example of bpelx:append 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.1.1, bpelx:append in BPEL 1.1, but the syntax is slightly different. Example 6–42 bpelx:append Extension in BPEL 2.0 bpel:assign bpelx:append bpelx:frombillOfMaterialVarb:partsb:partbpelx:from bpelx:toconsolidatedBillOfMaterialVarb:partsbpelx:from bpelx:append bpel:assign

6.14.2 How to Use bpelx:insertBefore

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

6.14.2.1 bpelx:insertBefore in BPEL 1.1

Example 6–43 provides an example of bpelx:insertBefore in a BPEL project that supports BPEL version 1.1. Example 6–43 bpelx:insertBefore Extension in BPEL 1.1 bpel:assign bpelx:insertBefore bpelx:from ... bpelx:to ... Note: The bpelx:insertBefore extension works with SDO variables, but the target must be the variable attribute into which the copied data must go.