Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

OSB: How to recreate reusable XQuery functions

1033781Jul 11 2009 — edited Jun 21 2013
OSB's XQuery implementation does not support the XQuery "module" which allows the creation of a function library so how can OSB provide function re-use?

I know you can create XQuery transformations that can be called but these always need a "body" that makes a specific call so I'm finiding I have to copy useful XQuery functions from one transformation to another. Ideally I should be able to call an XQuery function external to the transformation.

Does anyone have any pointers on this or is it a fundamental limitation of the OSB XQuery implementation?

regards

Comments

681888 Jul 12 2009
Hi,

i'm sorry...The Oracle Service Bus XQuery engine fully supports all of the language features that are described in the World Wide Web (W3C) specification for XQuery with one exception: modules

bye
718541 Aug 21 2009
So how do other people avoid having to copy and paste XQuery methods from one XQuery transformation to another?
671719 Sep 20 2009
In fact another possibility i use is the following.

Create an xquery application that you want to re-use, for example:
create_header($pars).

Then within another XQueries (create_message) you have to use the header as an external parameter, example (ASSIGN is the assign within a OSB pipeline)

ASSIGN $header := create_header($pars)
ASSIGN $message := create_message($header, $otherparameters)

This is not exactly what you want but you have created re-use and are able to unit test the xquery.
1033781 Sep 25 2009
Yes that kind of helps for "course" grained functions but gets clunky when trying to be more fine grained.

Is there any moves by the OSB development team to fully support XQuery 1.0 and the Module functionality in particular? It seems a pretty basic limitation to me and causes lots of "code duplication" that has to be maintained...
Alessandro I Nov 9 2010
any plans for making it available on OSB?
AbhishekJ Nov 9 2010
May be you can define custom XPath functions for fine grained utilities.
Here is a good article on how to define custom XPath functions on OSB 11G.
http://eelzinga.wordpress.com/2010/05/10/oracle-service-bus-11g-using-custom-xpath-functions/
Wim Veldhuis Apr 7 2011
What we did is creating a seperate project in which we use most of XQuery stuff, using SaxonSA library to run and validate the queries.

This project adds the following possibilities for xqueries:
- Schema validation of XPath used in XQueries (including namespaces)
- XQuery syntax validation (with errors at the exact line and position where it fails.
- Allows the use of modules
- Reqression testing XQueries

Regrettably we can not do Java callout's from XQueries as this is not supported on the ESB.

We also build a simple 'flattener' that takes a module based, schema enriched XQuery and then generates the XQuery that can be used on the ESB itself. The flattened query is also regression tested.

Although it was quite some work to make it, it already has paid back the initial costs of the project in the second or third project we did. We since then have enhanced the project so it also can do regression message flow validation on the OSB (we already had valid input and output messages).

The tool also greatly improves the stability of the code on the OSB, and reduces development time as we can build the XQuery from a unit test environment that will point out typos and other xpath related problems.

We do have some fairly complex xqueries on the OSB, the number of xqueries in the project at the moment is 187 with 250 unittests.

So, if Oracle is not going to include it in the OSB itself (which seems lilkely at the moment), you can build such a system yourself !

Wim Veldhuis,
PharmaPartners BV
user8951048 Mar 1 2013 — edited on Mar 1 2013
Hey mdsrobbins,

we have exactly the same problem. OSB XQuery code reusability is close to zero.

We have a hugh amount of transformations and unfortunaly we need to copy custom functions to all them. Nowadays our code is hard to maintain and message data enrichment is difficult to manage. We sadly need this functionality.

I have tested to outsource our code in custom functions by Java packages. Functionality was indeed available, but live editing is not possible due to compiled Java classes. Unless these custom functions are not deployable with WLST, we will not be capable to deliver fully automated OSB deployments. Besides, versioning the JAR next to the sbconfigs takes its effort on top (every additional artefact extends versioning complexity).

Does someone know, if the module import in OSB XQuery will be available in following releases (11g and up)?

Many greetings
user8951048 Jun 21 2013

same question,

Does someone know, if the module import in OSB XQuery will be available in following releases (11g and up)?


XQuery modules are very important for us. We have a huge amount of xq ressources and copy all our functions from one to another. Very frustrating. We need module import feature in OSB.

many greetings!

1 - 9
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 19 2013
Added on Jul 11 2009
9 comments
10,369 views