How to Use bpelx:remove

Manipulating XML Data in a BPEL Process 6-29 Example 6–55 Removal of Second Address Line bpel:assign bpelx:remove target variable=addrVar query=a:usAddressa:addressLine[2] bpelx:remove bpel:assign After executing the syntax shown in Example 6–56 in the BPEL process service component file, both address lines are removed: Example 6–56 Removal of Both Address Lines bpel:assign bpelx:remove target variable=addrVar query=a:usAddressa:addressLine bpelx:remove bpel:assign

6.14.4.2 bpelx:remove in BPEL 2.0

Example 6–57 provides an example of bpelx:remove 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.4.1, bpelx:remove in BPEL 1.1, but the syntax is slightly different. An extensionAssignOperation element wraps the bpelx:remove. Example 6–57 bpelx:remove Extension in BPEL 2.0 assign extensionAssignOperation bpelx:remove bpelx:targetncname.ncnamexpath_strbpelx:target bpelx:remove extensionAssignOperation assign

6.14.5 How to Use bpelx:rename and XSD Type Casting

The bpelx:rename extension in an assign activity enables a BPEL process service component to rename an element through use of XSD type casting. In Oracle BPEL Designer, you add the bpelx:rename extension by dragging the rename icon in the upper right corner of the Copy Rules tab to the target variable you want to remove, and releasing the cursor. The rename icon displays to the right of the remove icon shown in Figure 6–8 . After releasing the cursor, the Rename dialog is displayed for renaming the target variable.

6.14.5.1 bpelx:rename in BPEL 1.1

Example 6–58 provides an example of bpelx:rename in a BPEL project that supports BPEL version 1.1. Example 6–58 bpelx:rename Extension in BPEL 1.1 bpel:assign bpelx:rename elementTo=QName1? typeCastTo=QName2? bpelx:target variable=ncname part=ncname? query=xpath_str bpelx:rename bpel:assign 6-30 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite The syntax of bpelx:target is similar to and a subset of to-spec for the copy operation. The target must return a list of one more element nodes. Otherwise, a bpel:selectionFailure fault is generated. The element nodes specified in the from-spec are renamed to the QName specified by the elementTo attribute. The xsi:type attribute is added to those element nodes to cast those elements to the QName type specified by the typeCastTo attribute. Assume you have the employee list shown in Example 6–59 : Example 6–59 xsi:type Attribute e:empList e:emp e:firstNameJohne:firstNamee:lastNameDolee:lastName e:emp e:emp xsi:type=e:ManagerType e:firstNameJanee:firstNamee:lastNameDolee:lastName e:approvalLimit3000e:approvalLimit e:managing e:emp e:emp e:firstNamePetere:firstNamee:lastNameSmithe:lastName e:emp e:emp e:firstNameMarye:firstNamee:lastNameSmithe:lastName e:emp e:empList Promotion changes are now applied to Peter Smith in the employee list in Example 6–60 : Example 6–60 Application of Promotion Changes bpel:assign bpelx:rename typeCastTo=e:ManagerType bpelx:target variable=empListVar query=e:empListe:emp[.e:firstName=Peter and .e:lastName=Smith bpelx:rename bpel:assign After executing the above casting renaming, the data looks as shown in Example 6–61 with xsi:type info added to Peter Smith: Example 6–61 Data Output e:empList e:emp e:firstNameJohne:firstNamee:lastNameDolee:lastName e:emp e:emp xsi:type=e:ManagerType e:firstNameJanee:firstNamee:lastNameDolee:lastName e:approvalLimit3000e:approvalLimit e:managing e:emp e:emp xsi:type=e:ManagerType e:firstNamePetere:firstNamee:lastNameSmithe:lastName e:emp e:emp Manipulating XML Data in a BPEL Process 6-31 e:firstNameMarye:firstNamee:lastNameSmithe:lastName e:emp e:empList The employee data of Peter Smith is now invalid, because approvalLimit and managing are missing. Therefore, append is used to add that information. Example 6–62 provides an example. Example 6–62 Use of append Extension to Add Information bpel:assign bpelx:rename typeCastTo=e:ManagerType bpelx:target variable=empListVar query=e:empListe:emp[.e:firstName=Peter and .e:lastName=Smith bpelx:rename bpelx:append bpelx:from e:approvalLimit2500e:approvalLimit e:managing bpelx:from bpelx:to variable=empListVar query=e:empListe:emp[.e:firstName=Peter and .e:lastName=Smith bpelx:append bpel:assign With the execution of both rename and append, the corresponding data looks as shown in Example 6–63 : Example 6–63 rename and append Execution e:emp xsi:type=e:ManagerType e:firstNamePetere:firstNamee:lastNameSmithe:lastName e:approvalLimit2500e:approvalLimit e:managing e:emp

6.14.5.2 bpelx:rename in BPEL 2.0

Example 6–64 provides an example of bpelx:rename 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.5.1, bpelx:rename in BPEL 1.1, but the syntax is slightly different. An extensionAssignOperation element wraps the bpelx:rename. Example 6–64 bpelx:rename Extension in BPEL 2.0 bpel:assign extensionAssignOperation bpelx:rename elementTo=QName1? typeCastTo=QName2? bpelx:targetncname[.ncname][xpath_str]bpelx:target bpelx:rename extensionAssignOperation bpel:assign

6.14.6 How to Use bpelx:copyList

The bpelx:copyList extension in an assign activity enables a BPEL process service component to perform a copyList operation of the contents of one variable, expression, or XML fragment to another variable.