About Related Order Item Selector XQuery Expressions

This topic describes how to use the Transformation Sequence editor, Dependencies tab, Related Order Item Selector subtab, Expression area, XQuery subtab to write an expression that defines the related order items for a particular context order item. To see the Related Order Item Selector subtab, you must select a transformation stage in the tree on the Dependencies tab.

  • Context: The input document is a context order item.

  • Prolog: You can declare the order item namespace and the namespace for the order transformation manager functions in the XQuery prolog. For example:

    	declare namespace prop='http://oracle.communications.broadband;
    declare namespace otmfn="java:oracle.communications.ordermanagement.orchestration.transformation.XQueryFunctions.";
    
  • Body: The XQuery body returns the source order items related to the context order items.

The following example shows an XQuery expression that returns sibling order items as related order items to the order transformation.

	declare namespace prop='http://oracle.communications.broadband;
declare namespace otmfn="java:oracle.communications.ordermanagement.orchestration.transformation.XQueryFunctions.";
	let $siblings := otmfn:siblings (., ‘{http://oracle.communications.broadband}default')
	return $siblings[! fn:exists(osm:properties[prop:serviceInstance = 'Y'])]

For more information about the transformation.XQueryFunctions class, install the OSM SDK and extract the OSM Javadocs from the OSM_home/SDK/osm7.w.x.y.z-javadocs.zip file (where OSM_home is the directory in which the OSM software is installed and w.x.y.z represents the specific version numbers for OSM). See OSM Installation Guide for more information about installing the OSM SDK.