Tuesday, May 7, 2013

Working with DVM in SOA Suite 11G

Hi Folks,

Today, we are going to learn the concept of Domain Value Maps(DVM) in Oracle SOA Suite 11G. They enable you to map from one vocabulary used in a given domain to another vocabulary used in a different domain. For example, one domain may represent a city with a long name (Mumbai), while another domain may represent a city with a short name (MB). In such cases, you can directly map the values by using domain value maps.

Domain value map values are static. You specify the domain value map values at design time using Oracle JDeveloper, and then at runtime, the domain value map columns are looked up for values.

Use of DVM will be demonstrated in forecoming steps.Prior to that letme give you brief overview of our usecase.We will create a synchronous BPEL process that will receive inputs such as firstname,lastname,city and will retrurn corresponding city code in the output, along with full name.


Step1: First create a new SOA project "DVMTutorial" and create a new synchronous BPEL process named as "DVMProcess" based on WSDL

 Step2: Now lets create DVM.Go to NEW--> SOA Tier --> Domain Value Map and click OK. 
Step3: Wizard will open to create DVM.Give the name to dvm as "Cities.dvm" and under Domain Names add 2 fields "CityName" and "CityCode" with values as "Mumbai" and "MB" respectively.Click OK.
Step4: Cities.dvm will get created.Kindly note the extension of dvm files are ".dvm". Now add some more data to this DVM and save all.
Step5: Open your BPEL process.We will be manipulating the cityname in the input and will return corresponding CityCode in the output.For this, drag and drop assign activity between receive and reply activity.Drill down to City in your output variable and add expression.
Step6:  Scroll through list of avilable function and under "DVM Functions" ,insert lookupValue onto the expression field.If you see in the description of the function: 

dvm:lookupValue(dvmMetadataURI as string, SourceColumnName as string,SourceValue as string, TargetColumnName as string, DefaultValue as string) as string. 

It expects dvm to be used,source column name and source column value to be looked for in dvm and target column name whose corresponding value will be derived from DVM.
Step7: Insert values for source column as "CityName" and its value will be passed runtime during invocation of BPEL process,target column "CityCode" whose value will be looked upon at runtime.Your expression will look something like this: 

dvm:lookupValue("Cities.dvm","CityName",bpws:getVariableData('inputVariable','payload','/ns1:EmployeeDetails/ns1:emptype/ns1:City'),"CityCode","")

Step8:  Click OK,save all and deploy your composite to EM.

Testing your Composite:

Step1: Open up your composite from EM and click on Test Button.Pass values in all fields and under City field enetr "Mumbai" and test.You will see in the response document City value "MB".

Step2: Similarly test one more scenario passing "NewYork" in the City field and this time "NY" will come in response.

In this way we can use DVM in our projects for mapping dictionary from ome domain to another domain.Hope this post was useful for you guys.

Happy Learning,
Cheers.....

8 comments:

  1. Thanks for posting such a nice articles on SOA.
    I would also appreciate if you could post article on Cross Reference i.e. from 1 to 1 and 1 to many

    ReplyDelete
  2. Can u plz give the link to DOWNLOAD the wsdl for the BPEL

    ReplyDelete
  3. it's good Article but if we need to transfer non unique names twice, then how can we map it?

    ReplyDelete
    Replies
    1. Could you please elaborate your requirement ?

      Delete
  4. I have 5 different databases, these different databases sending differnt field names.
    My requirement is these differnt field names pass to one file by using dynamically changing .
    Is it possible, if it is possible pls help me.

    ReplyDelete