In the Unique Keys section, click the Add icon.

Manipulating XML Data in a BPEL Process 6-11

9. Click OK to close the Bind Entity dialog.

After the Bind Entity activity is executed at runtime, the entity variable is ready to be used. For more information about using SDOs, see Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. This guide describes how to expose application modules as web services and publish rows of view data objects as SDOs. The application module is the ADF framework component that encapsulates business logic as a set of related business functions.

6.3 Using Standalone SDO-based Variables

Standalone SDO-based variables are similar to ordinary BPEL XML-DOM-based variables. The major difference is that the underlying data form is SDO-based, instead of DOM-based. Therefore, SDO-based variables can use some SDO features such as Java API access, an easier-to-use update API, and the change summary. However, SDO usage is also subject to some restrictions that do not exist with XML-DOM-based variables. The most noticeable restriction is that SDO only supports a small subset of XPath expressions.

6.3.1 How to Declare SDO-based Variables

The syntax for declaring an SDO-based variable is similar to that for declaring BPEL variables. Example 6–5 provides details. Example 6–5 SDO-based Variable Declaration variable name=deptVar_s element=hrtypes:dept variable name=deptVar_v element=hrtypes:dept bpelx:sdoCapable=false If you want to override the automatic detection, use the bpelx:sdoCapable=true|false switch. For example, variable deptVar_v described in Example 6–5 is a regular DOM-based variable. Example 6–6 provides an example of the schema. Example 6–6 XSD Sample xsd:element name=dept type=Dept xsd:complexType name=Dept sdoJava:instanceClass=sdo.sample.service.types.Dept xsd:annotation xsd:appinfo source=Key xmlns=http:xmlns.oracle.combc4jservicemetadata key attributeDeptnoattribute key fetchModeminimalfetchMode xsd:appinfo xsd:annotation xsd:sequence xsd:element name=Deptno type=xsd:integer minOccurs=0 xsd:element name=Dname type=xsd:string minOccurs=0 nillable=true xsd:element name=Loc type=xsd:string minOccurs=0 nillable=true xsd:element name=Emp type=Emp minOccurs=0 maxOccurs=unbounded nillable=true xsd:sequence xsd:complexType 6-12 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

6.3.2 How to Convert from XML to SDO

Oracle BPEL Process Manager supports dual data forms: DOM and SDO. You can interchange the usage of DOM-based and SDO-based variables within the same business process, even within the same expression. The Oracle BPEL Process Manager data framework automatically converts back and forth between DOM and SDO forms. By using the entity variable XPath rewrite capabilities, Oracle BPEL Process Manager enables some XPath features for example, variable reference and function calls that the basic SDO specification does not support. However, there are other limitations on the XPath used with SDO-based variables for example, there is no support for and, or, and not. Example 6–7 provides a simple example of converting from XML to SDO. Example 6–7 XML-to-SDO Conversion assign copy from ns0:dept xmlns:ns0=http:sdo.sample.servicetypes xmlns:xsi=http:www.w3.org2001XMLSchema-instance ns0:Deptno10ns0:Deptno ns0:DnameACCOUNTINGns0:Dname ns0:LocNEW YORKns0:Loc ns0:Emp ns0:Empno7782ns0:Empno ns0:EnameCLARKns0:Ename ns0:JobMANAGERns0:Job ns0:Mgr7839ns0:Mgr ns0:Hiredate1981-06-09ns0:Hiredate ns0:Sal2450ns0:Sal ns0:Deptno10ns0:Deptno ns0:Emp ns0:Emp ns0:Empno7839ns0:Empno ns0:EnameKINGns0:Ename ns0:JobPRESIDENTns0:Job ns0:Hiredate1981-11-17ns0:Hiredate ns0:Sal5000ns0:Sal ns0:Deptno10ns0:Deptno ns0:Emp ns0:Emp ns0:Empno7934ns0:Empno ns0:EnameMILLERns0:Ename ns0:JobCLERKns0:Job ns0:Mgr7782ns0:Mgr ns0:Hiredate1982-01-23ns0:Hiredate ns0:Sal1300ns0:Sal ns0:Deptno10ns0:Deptno ns0:Emp ns0:dept from to variable=deptVar_s copy assign Example 6–8 provides an example of copying from an XPath expression of an SDO variable to a DOM variable.