About Wait Delay Duration XQuery Expressions

This topic describes how to use one of the following fields:

  • Orchestration Fulfillment Pattern editor, Orchestration Plan tab, Dependencies subtab, Wait Condition subtab, Wait Delay area, Duration Expression area XQuery subtab for the Duration selection

  • Orchestration Dependency editor, Wait for Condition tab, Wait Delay area, Duration Expression area XQuery subtab for the Duration selection

to write an expression that specifies the duration of delay, based on an order item property, before starting a waiting order component after all dependencies have been resolved.

  • Context: The Duration XQuery input document is the entire set of order items included in the order contained in the toOrderComponent element. You can return the value of requestedDeliveryDate to help determine the wait delay duration. For example:

    <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 [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 returns a duration value based on the requestedDeliveryDate order item property:

    let $mydate := osm:toOrderComponent[1]/osm:orderItem[1]/osm:properties[1]/*[namespace-uri()='http://oracle.communications.ordermanagement.unsupported.centralom' and local-name()='requestedDeliveryDate'][1]/text() 
    return  
    if (fn:current-dateTime()- xs:dateTime($mydate) < xs:dayTimeDuration('PT10H'))  then 
        'PT10H' 
    else 
        'PT10M'
    return
    

    where

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

    • osm:orderItem: These are the order items in the toOrderComponent category. The remainder of this expression identifies the namespace of the order item specification and returns the value of the requestedDeliveryDate element.

    • The if statement checks to see if the value of the requestedDeliveryDate is less than the hard-coded dayTimeDuration value. These values conform to the XSD duration data type.

    • The then statement returns 10 hours if the if statement evaluates to true.

    • The else statement return 10 months if the if statement evaluates to false.

The following example shows the sample XQuery to return a duration value.

declare namespace osm="http://xmlns.oracle.com/communications/ordermanagement/model"; 
declare namespace im="http://oracle.communications.ordermanagement.unsupported.centralom"; 
 
let $mydate := osm:toOrderComponent[1]/osm:orderItem[1]/osm:properties[1]/*[namespace-uri()='http://oracle.communications.ordermanagement.unsupported.centralom' and local-name()='requestedDeliveryDate'][1]/text() 
return  
if (fn:current-dateTime()- xs:dateTime($mydate) < xs:dayTimeDuration('PT10H'))  then 
    'PT10H' 
else 
    'PT10M'