Skip to Main Content

Integration

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!

Use custom xquery to lookup DVM in SOA 12c

Susmit DeyJun 21 2016 — edited Feb 26 2020

Hi All,

I need to use the below XQuery custom function in SOA Composite Project in 12c, it works for SB projects but not for SOA composite projects as the DVM lookup function is not resolved inside the XQuery, possibly because it is only available for the XSLT? Please help if you can give a solution to this problem.

xquery version "1.0" encoding "utf-8";

(:: OracleAnnotationVersion "1.0" ::)

declare namespace ngssp1="http://inatooo.com/nesp";

declare variable $origin as xs:string external;

declare variable $txnStartDateTime as xs:dateTime external;

declare function ngssp1:getSLAStatus($origin as xs:string,

                                     $txnStartDateTime as xs:dateTime)

                                     as xs:string {

                                   

                                   

    let $currentDateTime := fn:current-dateTime()

    let $elapsedTimeDuration := $currentDateTime - $txnStartDateTime

    let $elapsedTime := fn:seconds-from-duration($elapsedTimeDuration) * 1000

   let $slaTime := dvmtr:lookupValue("DemoSOAApplication/DVM/SLAInfo", "channel", $origin, "sla", "3600000",("service_class","default"))

  

    return

    if (number($elapsedTime) >= number($slaTime)) then

  

   fn:concat("SLA_FAIL: SLA WAS ",string($slaTime), " ELAPSED TIME: ", $elapsedTime)

  

    else

  

    fn:concat("SLA_OK: SLA WAS ",string($slaTime), " ELAPSED TIME: ", $elapsedTime)

  

};

ngssp1:getSLAStatus($origin, $txnStartDateTime)

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2016
Added on Jun 21 2016
3 comments
4,500 views