Order Jeopardy Automation XQuery Plug-ins
This topic provides information about order jeopardy XQuery expressions. These XQuery expressions apply to order jeopardies configured in the Order Jeopardy editor, not order jeopardies configured in the Order editor.
For general OSM XQuery information, see "General XQuery Information."
You can configure automations for order jeopardies in the Order Jeopardy editor, Automation tab. If you choose to use an XQuery automation type, create an XQuery file and reference it in the Script subtab Script field.
-
Context: The context for this XQuery is the Order Jeopardy Notification context.
-
Prolog: You should declare the XML namespace for the Order Jeopardy Notification context, and if you are using a date (rather than a duration) you can declare a namespace for the date format as well.
For example:
declare namespace context = "java:oracle.communications.ordermanagement.orderjeopardy.automation.OrderJeopardyNotificationContext"; declare namespace dateFormat = "java:java.text.DateFormat";
You should then declare the $context variable to contain the actual context:
declare variable $context external;
Then if you want to use order data in your XQuery, you can get the order data into a variable. For example:
let $orderData := fn:root(automator:getOrderAsDOM($automator))/oms:GetOrder.Response
You can then access individual data elements on the order. For example:
let $date := $orderData/oms:_root/oms:ojPostponeDate/text()
-
Body: There are several calls you can use in the order jeopardy XQuery file in addition to the normal calls available for notification plug-ins. Following are brief descriptions of the available calls:
-
postponeTimerOnExit(interval): If this call receives a numeric parameter, it postpones the due date for the number of milliseconds contained in the parameter.
-
postponeTimerOnExit(dateTime): If this call receives a date/time parameter, it postpones the due date to the indicated date/time.
-
logAndParkNotificationOnExit(logMessage): This call acknowledges the notification with the passed-in message, but does not reset/deactivate the notification. It will still be available in the Order Management web client.
-
ackNotificationOnExit: This call acknowledges and resets/deactivates the notification.
-
getNotificationAckStatus: This call returns true if the notification has been acknowledged, and false if it has not.
The following example postpones the jeopardy to a specified date:
declare namespace context = "java:oracle.communications.ordermanagement.orderjeopardy.automation.OrderJeopardyNotificationContext"; declare namespace dateFormat = "java:java.text.DateFormat"; declare variable $context external; let $dateFormat := dateFormat:getDateTimeInstance(3, 3) let $date := dateFormat:parse($dateFormat, "09/30/15 03:30 PM") return context:postponeTimerOnExit($context, $date)
-