Dynamic Value Mapping in OSB via Custom XPaths

I. Overview

OSB 11g R1 does not have DVM support. Now this is perfectly fine for clients who are using DVMs as part of the SOA Composites. But considering the fact that Oracle Mediator 11g has DVM functionality, and that many clients would have a migration path from Mediator based artifacts to OSB 11g, this can be a problem.
Clients can wait till Oracle releases the official support or resort to some ad hoc measures. Let’s look at such a solution. The solution is based on custom OSB XPaths.
1. An OSB Proxy Service DVMLookup exposes DVMs and is based on the following xml input:

This matches closely with the Oracle SOA 11g DVM lookup XPAth lookupValue(DVM_TABLE_NAME,SOURCE_COLUMN_NAME,SOURCE_COLUMN_VALUE,TARGET_COLUMN_NAME,DEFAULT_VALUE)
2. The customer DVMs can be added to the CommonServices/DVMs

3. This Service gets called via a Java class that is exposed as an OSB Custom XPath. The signature for the method call is
public static String lookupValue(String DVMTableName,String SourceColumnName,String SourceColumnValue,String TargetColumnName,String DefaultValue)
4. The dvm-custom xpath config file looks like this:


II. Installation

1. Download the package DVMLookup.zip. This contains the following:
a. OSB_Artifacts.jar: Contains the OSB Artifacts CommonServices and TestDVMLookup
b. CustomXPath : Contains the custom xpath components viz. dvm-custom.xml, dvmLookup.jar and dvm-custom.properties
c. SimpleDVMLookup: Contains the Eclipse project for the dvmLookup Java classes

2. Deploy the CommonServices and TestDVMLookup in OSB. In addition import these projects into OEPE.
3. Copy all the contents of CustomXPath into the location %OSB_HOME%/config/ xpath-functions
4. Restart Weblogic and OEPE. Weblogic admin startup log should show the DVM client successfully initiated

5. OEPE should show the custom xpath as follows:

III. Post – Installation Checks
1. The current Setup contains a predefined set of DVMs within CommonServices/DVMs folder:

2. Test the DVMLookup proxy service within DVMLookupTest /DVMTest with the following input in the body

3. The result response should be:

This completes the Post installation check

IV. Customizations
1. As already mentioned, the CommonServices/DVMs contains predefined DVMs. You would now need to insert your own dvms. Open your existing DVM and create a new XQuery Resource within the CommonServices/DVMs folder in OEPE or the OSB Console. You can use of the existing DVMs to insert your own values or copy the values in the template dvms, create a new XQuery Resource , paste the values and then modify the XQuery Resource with your own values.
2. The LoadDVM stage of the proxy loads the DVM based on the DVM Table name. Hence, you have to add another else-if condition to insert the new DVMTable you just created.

4. The Java code for the custom xpath is also included. This can be handy if you want to change the namespaces or the hostname for the DVM Proxy.

V. Usage
1. A typical XSLT transformation with the DVM Xpath looks like this:

2. Clearly, the only change is the namespace of the XPAth function. The new namespace is:
http://www.soa-utilities.com/osb/custom/xpath/soa.utilities.dvm.LookupTable
3. Each lookup call takes an average of 7 ms on a 4 GB Intel Core2 Duo@2.40 GHz running Weblogic Server and OSB. This would definitely perform a lot better in production boxes. To check for the exact lookup time, please execute the dvmLookup.jar on the installed machine. The default run tests for 100 lookups on one of the predefined DVMs.
java –jar %OSB_HOME%/config/xpath-functions/dvmLookup.jar

Resources:

1. DVMLookup Package (500 KB)

2. PDF whitepaper (200 KB)

Advertisements
Comments
4 Responses to “Dynamic Value Mapping in OSB via Custom XPaths”
  1. Roshan says:

    Hi Sandeep.
    can you help me. I am using customized XPath functions. I have put all the related files in the %OSB_HOME%/config/xpath-functions. It works fine in my development environment which is a single domain server.

    But when I am deploying it to my new UAT environment which a multiple domain server, its giving an error.
    My admin server is on port 7001 and managed server on 8001. In sbconcole which is on 7001, I can see my customized function is the Xquery function window. I can also click the test button in the Xquery design view and it works fine.

    But when I activate my proxy and then use the test console to run the proxy it gives an error. Test console executes the proxy on the managed server. I guess the run-time cannot find the custom jar file in the managed server.

    Do you have any idea which directory do I need to copy the jar file so tat it works both in the admin and managed server ?

    regards
    Roshan

    • The XPath functions internally communicate with the DVMs in the sbconsole via HTTP which is governed by a properties file. You might need to change the hostname:port in the properties file and then deploy to your production server. Please refer to the troubleshooting pointers at the end of the readme supplied with the DVMs.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: