How to Convert from XML to SDO

6-14 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Example 6–10 Literal Element Assignment assign -- copy from literal xml to the variable -- copy from result xmlns=http:samples.otn.com name symbol price12.3price quantity0quantity approved message result from to variable=output part=payload copy assign

6.5 Copying Between Variables

When you copy between variables, you copy directly from one variable or part to another variable of a compatible type, without needing to specify a particular field within either variable. In other words, you do not need to specify an XPath query.

6.5.1 How to Copy Between Variables

Example 6–11 shows two assignments being performed, first copying between two variables of the same type and then copying a variable part to another variable with the same type as that part. Example 6–11 Copying Between Variables assign copy from variable=c1 to variable=c2 copy copy from variable=c1 part = address to variable=c3 copy assign The BPEL file defines the variables shown in Example 6–12 : Example 6–12 Variable Definition variable name=c1 messageType=x:person variable name=c2 messageType=x:person variable name=c3 element=y:address The WSDL file defines the person message type shown in Example 6–13 : Example 6–13 Message Type Definition message name=person xmlns:x=http:tempuri.orgbpwsexample part name=full-name type=xsd:string part name=address element=x:address message Manipulating XML Data in a BPEL Process 6-15 For more information about this code example, see Section 9.3.2 of the Business Process Execution Language for Web Services Specification Version 1.1. For BPEL 2.0, see Section 8.4.4 of Web Services Business Process Execution Language Specification Version 2.0 for a similar example. For more information, see Section A.2.2, Assign Activity.

6.5.2 Initializing Variables with an Inline from-spec in BPEL 2.0

A variable can optionally be initialized by using an inline from-spec. Click the Initialize tab in the Create Variable dialog in a BPEL 2.0 project to create this type of variable. Inline variable initializations are conceptually designed as a virtual sequence activity that includes a series of virtual assign activities, one for each variable being initialized, in the order in which they appear in the variable declarations. Each virtual assign activity contains a single virtual copy operation whose from-spec is as given in the variable initialization. The to-spec points to the variable being created. Example 6–14 provides details. Example 6–14 Variable Initialization with an Inline from-spec variables variable name=tmp element=tns:output from literal output xmlns=http:samples.otn.combpel2.0ch8.1 value1000value output literal from variable variables For more information, see section 8.1 of Web Services Business Process Execution Language Specification Version 2.0.

6.6 Accessing Fields in Element and Message Type Variables

Given the types of definitions present in most WSDL and XSD files, you must go down to the level of copying from or to a field within part of a variable based on the element and message type. This in turn uses XML schema complex types. To perform this action, you specify an XPath query in the from or to clause of the assign activity.

6.6.1 How to Access Fields Within Element-Based and Message Type-Based Variables

In Example 6–15 , the ssn field is copied from the CreditFlow process’s input message into the ssn field of the credit rating service’s input message. Example 6–15 Field Copying Levels assign copy from variable=input part=payload query=tns:CreditFlowRequesttns:ssn to variable=crInput part=payload query=tns:ssn copy