Monday, 30 June 2014

Reading DVM values based on the a qualifier in SOA 11g



UseCase-
Sometime you want to read DVM values based on a combination like for example you want to retrieve StateCode based on the CountryCode and StateName.

Create a dvm





After this click on create domain name it  STATE.set qualifier as true.














Create a Sync bpel process based on this request response


<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.example.org"
            targetNamespace="http://www.example.org"
            elementFormDefault="qualified">
  <xsd:element name="request">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="countryCode" type="xsd:string"/>
        <xsd:element name="stateName" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="response">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="stateCode" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>
 








































dvm:lookupValue("STATECODE.dvm","COUNTRYCODE",/ns1:request/ns1:countryCode,"STATECODE","NA","STATE",/ns1:request/ns1:stateName)


Deploy it and test it