Tuesday, March 20, 2012

Oracle SOA Suite 11g - Domain Value Map Qualifier Support

Oracle SOA Suite 11g - Domain Value Map Qualifier Support:


Qualifier support is the new feature in Oracle SOA Suite 11g.Qualifiers qualifies mappings. A mapping may not be valid unless qualified with additional information. For example, a domain value map containing a city code-to-city name mapping may have multiple mappings from KN to Kensington because Kensington is a city in both Canada and the USA. Therefore, this mapping requires a qualifier (USA or Canada) to qualify when the mapping becomes valid

Country (Qualifier)CityCodeCityName
USABOBoston

USA
BELG_NC
Belgrade
USA
BELG_MN_Streams
Belgrade
USA
NP
Northport
USA
KN
Kensington
Canada
KN
Kensington


You can also specify multiple qualifiers for a domain value map

Country (Qualifier)State (Qualifier)CityCodeCityName
USAMassachusettsBOBoston
USANorth CarolinaBELGBelgrade
USAMinnesotaBELGBelgrade
USAAlabamaNPNorthport
USAKNKansasKensington
CanadaPrince Edward IslandKNKensington

A qualifier order is used to find the best match during lookup at runtime. The order of a qualifier varies from highest to lowest depending on the role of the qualifier in defining a more exact match. In above Table, the state qualifier can have a higher order than the country qualifier, as a matching state indicates a more exact match.

Domain value maps support hierarchical lookup. If you specify a qualifier value during a lookup and no exact match is found, then the lookup mechanism tries to find a more generalized match by setting the higher order qualifiers to a "". It proceeds until a match is found, or until a match is not found with all qualifiers set to a ""

State=Arkansas, Country=Canada, CityCode=KN_USA
In this example, the State qualifier has a qualifier value of 1 and the Country qualifier has a qualifier value of 2.
the lookup mechanism sets the higher order qualifier State to the exact lookup value Arkansas and uses Canada"" for the lower order qualifier Country.

When no match is found, the lookup mechanism sets the higher order qualifier State to a value of "" and sets the next higher qualifier Country to an exact value of Canada.
When no match is found, the lookup mechanism sets the value of the previous higher order qualifier Country to a value of "". One matching row is found where CityCode is KN_USA and Kensington is returned as a value.
Domain Value Map Lookup Result

StateCountryShort ValueLookup Result
ArkansasCANADA" "KN_USANo Match
“”CANADAKN_USANo Match
“”“”KN_USAKensington

DVM Lookup function to use the Qualifier

dvm:lookupValue(dvmMetadataURI as string, SourceColumnName as string,SourceValue as string, TargetColumnName as string, DefaultValue as string,(QualifierSourceColumn as string, QualifierSourceValue as string)*) as string
e.g
dvm:lookupValue ('cityMap.dvm','CityCodes','BO','CityNames', 'CouldNotBeFound', 'State', 'Massachusetts')

1 comment: