How To Assign a Literal XML Element

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 6-16 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite assign Example 6–16 shows how the BPEL file defines message type-based variables involved in this assignment: Example 6–16 BPEL File Definition - Message Type-Based Variables in BPEL 1.1 variable name=input messageType=tns:CreditFlowRequestMessage variable name=crInput messageType=services:CreditRatingServiceRequestMessage The crInput variable is used as an input message to a credit rating service. Its message type, CreditFlowRequestMessage, is defined in the CreditFlowService.wsdl file, as shown in Example 6–17 : Example 6–17 CreditFlowRequestMessage Definition message name=CreditFlowRequestMessage part name=payload element=tns:CreditFlowRequest message CreditFlowRequest is defined with a field named ssn. The message type CreditRatingServiceRequestMessage is defined in the CreditRatingService.wsdl file, as shown in Example 6–18 : Example 6–18 CreditRatingServiceRequestMessage Definition message name=CreditRatingServiceRequestMessage part name=payload element=tns:ssn message Example 6–19 shows the BPEL 2.0 syntax for how the BPEL file defines message type-based variables involved in the assignment in Example 6–15 . Note that tns:CreditFlowRequest is not required. Example 6–19 BPEL File Definition - Message Type-Based Variables in BPEL 2.0 copy frominput.payloadtns:ssnfrom tocrInput.payloadto copy A BPEL process can also use element-based variables. Example 6–20 shows how to use element-based variables in BPEL 1.1. The autoloan field is copied from the loan application process’s input message into the customer field of a web service’s input message. Example 6–20 Field Copying Levels in BPEL 1.1 assign copy from variable=input part=payload query=tns:invalidLoanApplicationautoloan: applicationautoloan:customer to variable=customer copy assign Example 6–21 shows how to use element-based variables in BPEL 2.0.