Search from 700 + Posts

Sep 21, 2010

Service Data Objects (SDOs) in Oracle ADF and How to Integrates SDOs with BPEL

A Service Data Object, or an SDO, is a standard defined by the Open Service Oriented Architecture consortium for providing access to business data, regardless of how it is physically accessed.The SDO specification adds a programming language-agnostic abstraction layer on top of technologies such as JDBC.SDO Unified access to heterogeneous data sources.

The SDO architecture is based on disconnected Data Graphs. Data graphs are tree structures of Data Objects retrieved from data sources, which are then accessed and modified by the client as part of its data processing logic. These changes are then persisted to the underlying data source in a consistent manner ensuring that data
in the data source that is being updated is not stale. These changes are detected and automatically applied by the SDO without the client having to invoke an update operation explicitly.

SDOs by themselves do not provide a mechanism to access a data store. This functionality is provided by a DAS, or Data Access Service. A Data Access Service queries data from data sources, builds the data graphs of the data objects retrieved,and applies the changes to the data back to the data source.


In Oracle SOA Suite we can expose the Data Objects like View objects(VOs) in ADF as SDO's  by means of ADF-BC Service interface. By saything this ,I mean we can Create SDO's from Data Objects (VO) by means of the Service Interface ( and then expose these SDOs to BPEL as partner links...keep reading)  .

Oracle SOA Suite 11g supports SDOs via a new feature in the BPEL component called Entity Variables. This feature allows developers to work with remote data as if it were local, without having to be too concerned about flushing and synchronizing the data it is operating on with the remote copy.

Entity variables can be declared in the globally at the process or any scope locally. We also called entity variable as , Entity Variables with Unique Keys, Please note that for each Entity variable , a Unique Key (e.g. Primary key ) must be associated with the corresponding Element (e.g. via XSD annotation). And, a activity should be assocaited to assign these Entity Variable with some unique key values.

The Entity Variable feature leverages Oracle ADF-BC (Advanced Developer Framework, Business Component) for data access services and tooling for creating SDOsand then use Entity variables to expose these SDO's in the BPEL.

Entity Variables automatically propagate data object changes through the ADF bc layer via "Change Summary" operations and can be used in BPEL by means of a partner link of either an SDO ( ADF-BC ) binding or SOAP ( WS ) binding reference to your ADF service.

When we exposed ADF-BC Service Layer to a BPEL process as a partnerLink, which is a (service) reference in SCA domain , ADF-BC integrated with BPEL not just a service rather it is capable of handling data changes( all the read -write Operations handled via partner links).

On Integration with BPEL , ADF-BC Service Layer create the below operations automatically generated as a part of the application module serivce interfac for every kind business data document during Desin time.( Offcousre while Creatin the Service Interface for ADF-BC we need Still to Select the options to generate below methods).


  1. find
  2. processChangeSummary
  3. process
  4. create
  5. delete
  6. update
  7. GetKey


Below are the examples of methods generated for the Business component "xxstocks"
    
      
      
      
      
      
      
      
  

Relation between SDO and BPEL 

Entity Variable is an extension to BPEL's ordinary variable. The usage of an Entity Variable is similar to BPEL's ordinary variable. For example, they can be manipulated by BPEL's activity.

On the other hand, there are a couple of fundamental differences of Entity Variable:
(1) the declaration of an Entity Variable needs to be based on a partnerLink of Data Mediator Service
(2) the Entity Variable needs to be associated with a set of unique key values before any data access happens.These two extra steps are expressed as BPEL's extension syntax.

By Data mediator - I mean Service that capable of handling data Changes.

Example(1) - Variable Decleration "stockInfoEV" based on the Partnerlink "stockWS" as shown below


                  bpelx:entity.si="stockWS" bpelx:sdoCapable="true"/>

Example(2) - variable associated with the Primary Key ItemID/WarehouseID ( I have hardcoded warehouse ID =1 for my testing).
            bpws:getVariableData('inputVariable','payload','/ns3:orderinput/ns3:itemid')
            number(1)
      

 In the above examples , I have defined the entity variables "StockInfoEV" and associate with the partnerlink "stockWSA" (represents an application service) that deals with business logic and data mediator logic for Item processing in a Warehouse.Also at the same time before I do any Xpath expression or Assign activity to this Entity variable , Entity Variable(EV) MUST needs to be associated with the Unique key ( item_id,warehouse_id in my example)

When a Entity Variable is used in BPEL, the data fetched through the partnerLink is always manifested in the form of SDO regardless of the underlying binding choice. So that the "ChangeSummary" feature in SDO is always available to make sure all kinds of data changes can be propagated back to the data mediator service. Since SDO is used to manifest Entity Variable, that also means embedded Java in BPEL can make use of SDO API to read and write data held by the Entity Variable.

Relation between SCA and SDO

Within an SCA composite, an external service reference can be configured with a binding that leverages SDO as the data passing mechanism. (Technically speaking, we are using Oracle's in an SCA configuration, instead of for SOAP and XML payload as the data passing mechanism.) This in turns enables an SCA component, which can be implemented by BPEL, within the SCA composite to communicate with the external service via SDO, while the external service may be a Data Mediator Service itself (e.g. ADF-BC app module with its service interface).


I will explain everything with Simple 2 Part Demo 
1.Creation and Explosing the data objects as SDOs in ADF by means of Service Interface.
2.Calling SDOs Created in Step-1 in BPEL flow by means of Entity variable.

2 comments:

  1. your post is nice . . let me tell u one thing that Blogs have become latest and important source of quality free information on net people enjoying for hours together. . .nice blog keep sharing;)
    Dissertation Writing Services

    ReplyDelete
  2. i really like your post .. i would like to bookmark your site for my future needs :)
    dissertations

    ReplyDelete