This topic describes how to use the Orchestration Sequence editor Fulfillment Mode area XQuery tab to write an expression that specifies the fulfillment mode for the orchestration sequence from a customer order element and has the following characteristics:
Context: The input document for the Fulfillment Mode Expression area XQuery is the customer order. For more information about typical customer order structures, see OSM Concepts.
Prolog: The input document for the Fulfillment Mode Expression area XQuery is the incoming customer order. You must declare the customer order namespace in the XQuery prolog.
Body: The XQuery body must specify the fulfillment mode.
Typically, the fulfillment mode is specified in the order header. For example:
<im:FulfillmentModeCode>Deliver</im:FulfillmentModeCode>
In the following example, the XQuery looks in the incoming customer order (SalesOrder) for the <FulfillmentModeCode> element. It returns the text contained in that element.
declare namespace im="http://xmlns.oracle.com/InputMessage"; <osm:fulfillmentMode name="{fn:normalize-space(.//im:SalesOrder/im:DataArea/im:FulfillmentModeCode/text())}"
This is the XML in the incoming customer order:
<im:FulfillmentModeCode>Deliver</im:FulfillmentModeCode>
In this case, the XQuery returns Deliver.