Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle Design Studio (OSM): Data dictionary stays unpopulated even after extraction in xquery code

6659fe49-583e-49a2-96a5-7acdf019d957Jan 2 2019 — edited Mar 23 2019

I want to extract productItem data from the data catalog, but I still see the data unpopulated on the console. Please review my code to let me know if there's something I'm missing, because I've spent an entire day and had several colleagues look it over with no productive solution.

I've tried debugging the code by hardcoding a value in the "productItem" tag, which does appear on the OrderManagement console. It seems like it may not be a problem in the code, but a problem with the data that I am trying to extract. The code I have written is as follows:

import module namespace orderdetails = "orderdetails" at "http://xmlns.ptcl.com/ordermanagement/somorderfulfillment/utilities/functions/OrderDetailsMappingModule.xquery";

declare namespace oms= "urn:com:metasolv:xmlapi:1";

declare namespace automator = "java:oracle.communications.ordermanagement.automation.plugin.ScriptReceiverContextInvocation";

declare namespace context = "java:com.mslv.oms.automation.TaskContext";

declare namespace log = "java:org.apache.commons.logging.Log";

declare namespace saxon = "http://saxon.sf.net/";

declare namespace xsl = "http://www.w3.org/1999/XSL/Transform";

declare namespace cat= "http://www.ibm.com/decomposeCustomerOrderService/";

declare variable $automator external;

declare variable $context external;

declare variable $log external;

declare option saxon:output "method=xml";

declare option saxon:output "saxon:indent-spaces=4";

let $catalogResponse := .

let $orderNumber := $catalogResponse/decomposeCustomerOrder/orderNumber/text()

let $CatalogResponseCode := $catalogResponse/returnCode/text()

let $taskDataOrder := fn:root(automator:getOrderAsDOM($automator))/oms:GetOrder.Response

(:let $offeredService:= $catalogResponse/decomposeCustomerOrder/offeredServices/item:)

let $xmlSerialized := saxon:serialize($catalogResponse, <xsl:output method='xml' omit-xml-declaration='yes' indent='yes' saxon:indent-spaces='4'/>)

let $logStr := fn:concat($orderNumber,"|Catalog Response Received|",$xmlSerialized)

return

**(**

**automator:setUpdateOrder($automator, 'true'),**

**\<OrderDataUpdate>**

    **\<UpdatedNodes>**

        **\<\_root>**

            **\<decompositionDetails>**

                **\<productsList>**

                **{**

for $productItem in $catalogResponse/decomposeCustomerOrder/offeredServices/item/products/item

let $idProductItem := $productItem/id/text()

let $CFSItems := $catalogResponse/decomposeCustomerOrder/offeredServices/item/customerServices/item[parentProduct/id/text() = $idProductItem]

let $logStr1 := fn:concat("|ID Product ITEM |",$idProductItem)

return

log:info($log,$logStr1),

<productItem>

<productID>{$productItem/text()}</productID>

</productItem>,

log:info($log,"After product Item close tag")

}

                **\</productsList>**

            **\</decompositionDetails>**

        **\</\_root>**

    **\</UpdatedNodes>**

**\</OrderDataUpdate>,**

log:info($log, $logStr),

**context:completeTaskOnExit($context, 'success')**

**)**

I am expecting to see the data populated when I see the order in the OrderManagement console. However, the "productItem" view is seen empty, as shown below:

IMAGE$652427A96205796B.jpg

Comments

Post Details

Added on Jan 2 2019
1 comment
286 views