About Associating Order Items Using Property Correlations XQuery Expressions

This topic describes how to use the Orchestration Fulfillment Pattern editor, Orchestration Plan tab, Order Components subtab, Order Item Association subtab, Property Correlation selection, XQuery subtab to write an expression that associates order items to order components that are not assigned by their orchestration fulfillment pattern. These order item associations are typically required when external systems need a specific context for an order item and includes the following characteristics:

  • Context: The Order Item Association subtab XQuery input documents are multiple order items in the order after decomposition contained in the fromOrderComponent element and the entire set of order items included in the order contained in the toOrderComponent element. You can make an XQuery association based on the contents of these order items that create an association between the unique order item IDs. For example:

    <fromOrderComponent xmlns="">
       <osm:orderItem 
        xmlns:osm="http://xmlns.oracle.com/communications/ordermanagement/model"
        id="1234">
          <osm:name>Speed By Demand [Add]</osm:name>
    .....
          <osm:properties
           xmlns:im="http://oracle.communications.ordermanagement.unsupported.
           centralom">
             <im:typeCode>PRODUCT</im:typeCode>
             <im:parentLineId>3</im:parentLineId>
             <im:requestedDeliveryDate>2013-06-31T12:00:00
             </im:requestedDeliveryDate>
             <im:lineItemName>Commercial Fixed Service [Add]</im:lineItemName>
             <im:lineId>4</im:lineId>
             <im:SiteID>10</im:SiteID>
             <im:ServiceActionCode>UPDATE</im:ServiceActionCode>
             <im:productClass>Speed by Demand class</im:productClass>
             <im:serviceId>552131313131</im:serviceId>
             <im:productSpec>Service.Fixed</im:productSpec>
             <im:lineItemPayload> [34 lines]
             <mi:region>Sao Paulo</im:region>
          <osm:properties>
       </osm:orderItem>
       <osm:orderItem [37 lines] 
       <osm:orderItem [42 lines]
       <osm:orderItem [57 lines]
       <osm:orderItem [57 lines]
    </fromOrderComponent>
    <toOrderComponent xmlns="">
       <osm:orderItem [35 lines]
       <osm:orderItem [37 lines]
       <osm:orderItem [42 lines]
       <osm:orderItem 
        xmlns:osm="http://xmlns.oracle.com/communications/ordermanagement/model"
        id="5678">
          <osm:name>Broadband Bundle [Add]</osm:name>
    .....
          <osm:properties
           xmlns:im="http://oracle.communications.ordermanagement.unsupported.
           centralom">
             <im:typeCode>PRODUCT</im:typeCode>
             <im:parentLineId>3</im:parentLineId>
             <im:requestedDeliveryDate>2013-06-31T12:00:00
             </im:requestedDeliveryDate>
             <im:lineItemName>Broadband Bundle [Add]</im:lineItemName>
             <im:lineId>4</im:lineId>
             <im:SiteID>10</im:SiteID>
             <im:ServiceActionCode>UPDATE</im:ServiceActionCode>
             <im:productClass>Broadband Bundle Class</im:productClass>
             <im:serviceId>1112223333</im:serviceId>
             <im:productSpec>Broadband.Bundle</im:productSpec>
             <im:lineItemPayload> [34 lines]
             <im:region>Sao Paulo</im:region>
          <osm:properties>
       </osm:orderItem>
       <osm:orderItem [57 lines]
       <osm:orderItem [57 lines]
       <osm:orderItem [42 lines]
       <osm:orderItem [37 lines]
       <osm:orderItem [37 lines]
       <osm:orderItem [57 lines]
    </toOrderComponent>
    
  • Prolog: You can declare the order item namespace and the OSM namespace in the XQuery prolog. For example:

    declare namespace osm="http://xmlns.oracle.com/communications/ordermanagement/model";
    declare namespace im="http://oracle.communications.ordermanagement.unsupported.centralom";
    
  • Body: The XQuery body must specify a dependency between the order item and the associated order item using something similar to the following syntax:

    let $fromItem := osm:fromOrderComponent/osm:orderItem[osm:name/text()="Speed By Demand [Add]"]
    let $toItem := osm:toOrderComponent/osm:orderItem[osm:name/text()="Broadband Bundle [Add]" and osm:properties/im:SiteID/text() = $fromItem/osm:properties/im:SiteID/text()]
    return
    <osm:dependency fromOrderItemId='{$fromItem/@id}' toOrderItemId='{$toItem/@id}'/> 
    

    where

    • osm:fromOrderComponent: Returns the set of order items included in the order component after the decomposition phase.

    • osm:toOrderComponent: Returns the entire set of order items included in the order.

    • osm:orderItem: These are the order items in the fromOrderComponent or toOrderComponent categories.

    • osm:dependency fromOrderItemId='{$fromItem/@id}: The output of the XQuery specifying the source order item ID for the association.

    • toItem='{$childOrderItem/@id}'/>: The output of the XQuery specifying the target order item ID for the association.

    Given the sample provided in the context bullet, this XQuery would return the following association:

    <osm:dependency fromOrderItemId='1234' toOrderItemId='5678'/> 
    

The following example shows an XQuery that associates all child order items with their parent items. (See OSM Modeling Guide for more information.) The output of the XQuery expression returns a node-set of <osm:dependency fromOrderItemId='{$fromOrderItem/@id}' toOrderItemId=' {$toOrderItem/@id}'/> where item IDs are the @id attribute of the order item.

declare namespace osm="http://xmlns.oracle.com/communications/ordermanagement/model";
declare namespace prop="http://oracle.communications.ordermanagement.unsupported.centralom";
(:   $fromOrderItemList contains all order items in the selected order component:   :)
for $fromOrderItem in $fromOrderItemList
let $fromOrderItemList := osm:fromOrderComponent/osm:orderItem
(:    $childOrderItems contains all children for the current $fromOrderItem:    :)
let $childOrderItems := osm:toOrderComponent/osm:orderItem/osm:properties
      [prop:ParentLineID/text() = $fromOrderItem/osm:properties/prop:LineID/text()]
(:    Returns the association between all parents and their children:    :)
for $childOrderItem in $childOrderItems
return
  <osm:dependency fromOrderItemId='{$fromOrderItem/@id}' toOrderItemId='{$childOrderItem/@id}'/>