How to Use Assign Extension Attributes

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. Manipulating XML Data in a BPEL Process 6-37 For more information about the keepSrcElementName attribute, see Section 6.14.7.3, keepSrcElementName Attribute.

6.17 Mapping WSDL Message Parts in BPEL 2.0

The toParts element in invoke and reply activities provides an alternative to explicitly creating multipart WSDL messages from the contents of BPEL variables. When you use the toParts element, as shown in Example 6–72 , an anonymous, temporary WSDL variable is defined based on the type specified by the input message of the appropriate WSDL operation. Example 6–72 toParts Element toParts toPart part=payload fromVariable=request toParts The toParts element acts as a single, virtual assign activity. Each toPart acts as a copy operation. One toPart at most exists for each part in the WSDL message definition. Each copy operation copies data from the variable specified in the fromVariable attribute into the part of the anonymous, temporary WSDL variable referenced in the part attribute of the toParts element. The fromParts element in receive activities, invoke activities, the onEvent branch of scope activities, and the onMessage branch of pick activities is similar to the toParts element. The fromParts element, as shown in Example 6–73 , retrieves data from an incoming multipart WSDL message and places the data into individual variables. Example 6–73 fromParts Element fromParts fromPart part=payload toVariable=request fromParts When a WSDL message is received on an invoke activity that uses fromParts elements, the message is placed in an anonymous, temporary WSDL variable of the type specified by the output message of the appropriate WSDL operation. As with the toParts element, the fromParts element acts as a single virtual assign activity. Each fromPart acts as a copy operation. Each copy operation copies the data at the part of the anonymous, temporary WSDL variable referenced in the part attribute of the fromPart into the variable indicated in the toVariable attribute. Table 6–6 Mapping WSDL Message Parts For The... The... inputVariable attribute Value of the variable referenced by the attribute sets the value of the part in the anonymous temporary WSDL message variable. outputVariable attribute Value of the received part in the temporary WSDL message variable sets the value of the variable referenced by the attribute. Receive activity Incoming part’s value sets the value of the variable referenced by the variable attribute. Reply activity Value of the variable referenced by the variable attribute sets the value of the part in the anonymous, temporary WSDL message variable that is sent out. For a reply activity sending a fault, the same scenario applies.