Monday, September 16, 2019

12c SOA - Domain value Map (DVM)

Introduction:
  • DVM enables 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 Country with a long name (INDIA), while another domain may represent a Country with a short name (IN). 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. 
  • We can also add/modify the DVM values from SOA composer.
Note: To use dynamic value mapping, XREF(Cross Reference) is used.

Here we will show the mapping from Country codes to Country names using DVM.

Implementation steps:
Step1: Create an empty project and a XSD for input and output of the service.







XSD used:
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.emp.text"
            targetNamespace="http://www.emp.text" elementFormDefault="qualified">
  <xsd:element name="EmployeeInput">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="EmpId" type="xsd:string"/>
        <xsd:element name="EmpName" type="xsd:string"/>
        <xsd:element name="EmpCountryCode" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="EmployeeOutput">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="EmpId" type="xsd:string"/>
        <xsd:element name="EmpName" type="xsd:string"/>
        <xsd:element name="EmpCountryName" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Step2: Create a DVM for mapping from Country codes to Country Names.




Step3: Create Synchronous BPEL Process and use the DVM function in assign activity to map to the response,





Format :
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 and a default value if nothing matched from the DVM.
Note: Here I have imported the created DVM in SOA MDS and then used the oramds path.

Step4: Deploy and test.



No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...