Skip Headers
Oracle® Communications Design Studio Modeling OSM Orchestration
Release 7.2.4
Go to Design Studio Help Home
Go to Table of Contents
Go to Feedback page

Go to previous page
Go to next page
Mobi · ePub

About Validation Rule XQuery Expressions

This topic describes how to use the Order Recognition Rule editor Validation Rule area XQuery tab to write an expression that specifies nodes in the incoming customer order that must evaluate to true to accept the customer order into the system. The XQuery has the following characteristics:

The following sample XQuery checks for the existence of a sender ID:

if (fn:exists(./header/c:Sender/c:ID) and ./header/c:Sender/c:ID != '')
  then (true())
     else concat("SEVERE", "Message Header should contain Sender ID", header/Sender/ID")

The following sample XQuery checks for correct values in the typeCode data element in the incoming customer order:

if (fn:exists($orderLine/im:ItemReference/im:TypeCode) 
    and 
    $orderLine/im:ItemReference/im:TypeCode != '') 
then 
    (
    if ($orderLine/im:ItemReference/im:TypeCode = "PRODUCT" or 
        $orderLine/im:ItemReference/im:TypeCode = "OFFER" or 
        $orderLine/im:ItemReference/im:TypeCode = "BUNDLE") then ()
    else
       local:reportIssue("ERROR", "Product Type should be one of: PRODUCT, OFFER, BUNDLE", 
             $lineNum, "ProcessProvisioningOrderEBM/DataArea/ProcessProvisioningOrder/
                        ProvisioningOrderLine/ItemReference/TypeCode")
)

Given this XQuery sample, the following part of a customer order would evaluate to true because the typeCode element value is BUNDLE.

<!-- FIXED BUNDLE - BUNDLE -->
<im:salesOrderLine>
          <im:lineId>2</im:lineId>
  <im:promotionalSalesOrderLineReference>1</im:promotionalSalesOrderLineReference>
          <im:serviceId></im:serviceId>
        <im:requestedDeliveryDate>2001-12-31T12:00:00</im:requestedDeliveryDate>
        <im:serviceActionCode>Add</im:serviceActionCode>
                        <im:itemReference>
                                        <im:name>Fixed Bundle</im:name>
                                        <im:typeCode>BUNDLE</im:typeCode>
                                        <im:specificationGroup />
        </im:itemReference>
</im:salesOrderLine>

For more information about validation rules see OSM Concepts.