How to Copy Between Variables

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. Manipulating XML Data in a BPEL Process 6-17 Example 6–21 Field Copying Levels in BPEL 2.0 assign copy frominput.payloadautoloan:applicationautoloan:customerfrom tocustomerto copy assign Example 6–22 shows how the BPEL file defines element-based variables involved in an assignment: Example 6–22 BPEL File Definition - Element-Based Variables variable name=customer element=tns:customerProfile

6.7 Assigning Numeric Values

You can assign numeric values in XPath expressions.

6.7.1 How to Assign Numeric Values

Example 6–23 shows how to assign an XPath expression with the integer value of 100. Example 6–23 XPath Expression Assignment assign -- copy from integer expression to the variable -- copy from expression=100 to variable=output part=payload query=p:resultp:quantity copy assign

6.8 Using Mathematical Calculations with XPath Standards

You can use simple mathematical expressions like the one in Section 6.8.1, How To Use Mathematical Calculations with XPath Standards, which increment a numeric value.

6.8.1 How To Use Mathematical Calculations with XPath Standards

In Example 6–24 , the BPEL XPath function getVariableData retrieves the value being incremented. The arguments to getVariableData are equivalent to the variable, part, and query attributes of the from clause including the last two arguments, which are optional. Example 6–24 XPath Function getVariableData Retrieval of a Value assign copy from expression=bpws:getVariableDatainput, payload, p:value + 1 to variable=output part=payload query=p:result copy assign You can also use variable syntax in BPEL 1.1, as shown in Example 6–25 :