Oracle Domain Value Maps and Business Rules runtime edit with SOA Composer
November 27, 2009 4 Comments
Last week there was a question on the forum how to add values to the domain value maps on runtime.
In the Oracle SOA Suite 10g we could maintain those values from the console.
In Fusion 11g it’s a little bit different.
Oracle now supplies us a new tool called SOA Composer (patch set 1). This new tool can be used to maintain both rules and domain value maps at runtime.
- Create a new composite and add a dvm to it
- Create a new dvm
- Create the transformation in the mediator and connect the dvm

Select the project, goto File > New > SOA Tier > Transformation > Domain Value Map
<xsl:template match="/">
<inp1:CountryInfo>
<inp1:Code>
<xsl:value-of select="/inp1:Input/inp1:Code"/>
</inp1:Code>
<inp1:Fullname>
<xsl:value-of select="dvm:lookupValue("Countries.dvm","CODE",/inp1:Input/inp1:Code,"Fullname",'not mapped')"/>
</inp1:Fullname>
</inp1:CountryInfo>
</xsl:template>
Now deploy the composite and do a little test to see if the dvm works.

In my case it generated the file ‘my_dvm_out_1.txt’ with the next content :
<?xml version="1.0" encoding="UTF-8" ?><inp1:CountryInfo xmlns:inp1="http://xmlns.oracle.com/singleString" xmlns="http://xmlns.oracle.com/singleString"> <inp1:Code>NL</inp1:Code> <inp1:Fullname>Netherlands</inp1:Fullname> </inp1:CountryInfo>
Test again from the console with the code DE. Content of my file :
<?xml version="1.0" encoding="UTF-8" ?><inp1:CountryInfo xmlns:inp1="http://xmlns.oracle.com/singleString" xmlns="http://xmlns.oracle.com/singleString"> <inp1:Code>DE</inp1:Code> <inp1:Fullname>not mapped</inp1:Fullname> </inp1:CountryInfo>
Time to add the dvm lookup for code DE.
SOA Composer
The SOA Composer can be found at: http://hostname:port_of_soa_managed_server/soa/composer
Login into the console and go to Open > Open DVM. Open the correct DVM.


Click Edit at top and click the green arrow to add a new lookup.


Last step is to commit the changed dvm (without redeploy).
Let’s test the process again and check the content of file.
<?xml version="1.0" encoding="UTF-8" ?><inp1:CountryInfo xmlns:inp1="http://xmlns.oracle.com/singleString" xmlns="http://xmlns.oracle.com/singleString"> <inp1:Code>DE</inp1:Code> <inp1:Fullname>Deutschland</inp1:Fullname> </inp1:CountryInfo>
Looks like it works.
Nice new tool from Oracle, available in the new patchset 1 of SOA Suite 11g.

