How to Use bpelx:copyList

Manipulating XML Data in a BPEL Process 6-33 sequence complexType element element name=processResponse complexType sequence element name=payload type=string maxOccurs=unbounded sequence complexType element schema The from variable contains the content shown in Example 6–67 . Example 6–67 Variable Content ns1:process xmlns:ns1=http:xmlns.oracle.comEvent_jwsEventEventTest ns1: payload ans1: payload ns1: payload bns1: payload ns1:process The to variable contains the content shown in Example 6–68 . Example 6–68 Variable Content ns1:processResponse xmlns:ns1=http:xmlns.oracle.comEvent_ jwsEventEventTest ns1: payload cns1: payload ns1:process The bpelx:copyList operation looks as shown in Example 6–69 . Example 6–69 bpelx:copyList assign bpelx:copyList bpelx:from variable=inputVariable part=payload query=client:processclient:payload bpelx:to variable=outputVariable part=payload query=client:processResponseclient:payload bpelx:copyList assign This makes the to variable as shown in Example 6–70 . Example 6–70 Variable Content ns1:processResponse xmlns:ns1=http:xmlns.oracle.comEvent_ jwsEventEventTest ns1: payload ans1: payload ns1: payload bns1: payload ns1:process

6.14.6.2 bpelx:copyList in BPEL 2.0

Example 6–71 provides an example of bpelx:copyList 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.6.1, bpelx:copyList in BPEL 1.1, but the syntax is slightly different. An extensionAssignOperation element wraps the bpelx:copyList extension. 6-34 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Example 6–71 bpelx:copyList Extension in BPEL 2.0 assign extensionAssignOperation bpelx:copyList bpelx:frominputVariable.payloadclient:payloadbpelx:from bpelx:tooutputVariable.payloadclient:payloadbpelx:to bpelx:copyList extensionAssignOperation assign

6.14.7 How to Use Assign Extension Attributes

You can assign the following attributes to copy rules in an assign activity. ■ ignoreMissingFromData ■ insertMissingToData ■ keepSrcElementName At the bottom of the Copy Rules tab of an assign activity, you right-click a selected copy rule to display a menu for choosing the appropriate attribute. Figure 6–10 provides details. Figure 6–10 Assign Extension Attributes

6.14.7.1 ignoreMissingFromData Attribute

The ignoreMissingFromData attribute suppresses any bpel:selectionFailure standard faults. Table 6–3 describes the syntax differences between BPEL versions 1.1 and 2.0.

6.14.7.2 insertMissingToData Attribute

The insertMissingToData attribute instructs runtime to complete the XPath L-value specified by the to-spec, if no items were selected. Table 6–4 describes the syntax differences between BPEL versions 1.1 and 2.0. Table 6–3 ignoreMissingFromData Attribute Syntax BPEL 1.1 BPEL 2.0 copy bpelx:ignoreMissingFromData=yes|no copy ignoreMissingFromData=yes|no Table 6–4 insertMissingToData Attribute Syntax BPEL 1.1 BPEL 2.0 copy bpelx:insertMissingToData=yes|no copy bpelx:insertMissingToData=yes|no Manipulating XML Data in a BPEL Process 6-35

6.14.7.3 keepSrcElementName Attribute

The keepSrcElementName attribute enables you to replace the element name of the destination as selected by the to-spec with the element name of the source. This attribute was not implemented in BPEL 1.1. Table 6–5 describes the syntax supported in BPEL version 2.0.

6.15 Validating XML Data

You can verify code and identify invalid XML data in a BPEL project.

6.15.1 How to Validate XML Data in BPEL 1.1

■ In an assign activity in Oracle BPEL Designer:

1. From the BPEL Constructs section of the Component Palette, drag an Assign

activity into the designer.

2. Double-click the Assign activity.

3. In the General tab, enter a name for the activity and select the Validate

checkbox.

4. Click Apply, then OK.

5. Click the Source tab to view the syntax.

assign name=Assign1 bpelx:validate=yes . . . assign ■ In a standalone, extended validate activity in Oracle BPEL Designer that can be used without an assign activity:

1. From the Oracle Extensions section of the Component Palette, drag a Validate

activity into the designer.

2. Double-click the Validate icon.

3. Enter a name for the activity.

4. Click the Add icon to select the variable to validate.

5. Select the variable, then click OK.

6. Click Apply, then OK.

7. Click the Source tab to view the syntax.

bpelx:validate name=Validate1 variables=inputVariable

6.15.2 How to Validate XML Data in BPEL 2.0

■ In an assign activity in Oracle BPEL Designer:

1. From the BPEL Constructs section of the Component Palette, drag an Assign

activity into the designer.

2. Double-click the Assign activity.

Table 6–5 keepSrcElementName Attribute Syntax BPEL 1.1 BPEL 2.0 Not implemented copy keepSrcElementName=yes|no 6-36 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

3. In the General tab, enter a name for the activity and select the Validate

checkbox.

4. Click Apply, then OK.

5. Click the Source tab to view the syntax. Note that the syntax for validating

XML data with the assign activity is slightly different between BPEL versions 1.1 and 2.0. assign name=Assign1 validate=yes . . . assign ■ In a standalone, extended validate activity in Oracle BPEL Designer that can be used without an assign activity:

1. From the BPEL Constructs section of the Component Palette, drag a Validate

activity into the designer.

2. Double-click the Validate icon.

3. Enter a name for the activity.

4. Click the Add icon to select the variable to validate.

5. Select the variable, then click OK.

6. Click Apply, then OK.

7. Click the Source tab to view the syntax. Note that the syntax for validating

XML data with the validate activity is slightly different between BPEL versions 1.1 and 2.0. validate name=Validate1 variables=inputVariable

6.16 Using Element Variables in Message Exchange Activities in BPEL 2.0

You can specify variables in the following message exchange activities: ■ The Input field for an inputVariable attribute and Output field for an outputVariable attribute of an invoke dialog ■ The Input field for a variable attribute of a receive activity ■ The Output field for a variable attribute of a reply activity The variables referenced by these fields typically must be message type variables in which the QName matches the QName of the input and output message types used in the operation, respectively. The one exception is if the WSDL operation in the activity uses a message containing exactly one part that is defined using an element. In this case, a variable of the same element type used to define the part can be referenced by the inputVariable and outputVariable attributes, respectively, in the invoke activity or the variable attribute of the receive or reply activity. Using a variable in this situation must be the same as declaring an anonymous, temporary WSDL message variable based on the associated WSDL message type. Copying element data between the anonymous, temporary WSDL message variable and the element variable acts as a single virtual assign with one copy operation whose keepSrcElementName attribute is set to yes. The virtual assign must follow the same rules and use the same faults as a real assign activity. Table 6–6 provides details.