Monday, 28 October 2013

For-each XSLT in Xquery FOR Expression | OSB FLWOR | For Iterator in Xquery Expression

Performing for-each Mapping in OSB using XQuery Expression.



Individually I am able to receive the values from source(L.H.S) Structure using below XQuery expressions:

· $body/sfd:QLIRequestElement/sfd:inRequest/sfd:LineItems/sfd:listprice/text()

· $body/sfd:QLIRequestElement/sfd:inRequest/sfd:LineItems/sfd:Quantity/text()

· $body/sfd:QLIRequestElement/sfd:inRequest/sfd:LineItems/sfd:MaterialId/text()

· $body/sfd:QLIRequestElement/sfd:inRequest/sfd:LineItems/sfd: Netunitprice/text()

In Order to Iterate over the List of LineItems,I can use the F of FLWOR Expression,which stands for FOR.

The behavior of the for clause is straight forward: it iterates over a list of Items and calculates some value for each item in that list, and returns a list obtained by concatenating the results of these calculations.

return







File: Query.xquery

<cars>
{for $i in (1,3,5,7,9) return <mycar>{$i}</mycar>}
</cars>
Output:

<?xml version="1.0" encoding="UTF-8"?>
<cars>
<mycar>1</mycar><mycar>3</mycar><mycar>5</mycar><mycar>7</mycar><mycar>9</mycar>
</cars>


Extending the above logic on XML source carrying List of <LineItems>, We need to introduce an iterator $var1 to iterateover <LineItems> having Zero or more repetition.,

And we need to return the resultant expression for each iteration in the List






<qlir:QLIRequest xmlns:qlir="http://soap.sforce.com/schemas/class/QLIRequest">

<qlir:inRequest>

<qlir:EAIHeader>

<qlir:applicationId>{$body/sfd:QLIRequestElement/sfd:eaiHeader/sfd:applicationId/text()}</qlir:applicationId>

<qlir:transactionId>string</qlir:transactionId>

<qlir:messageId>string</qlir:messageId>

<qlir:messageHistory>string</qlir:messageHistory>

<qlir:tracingId>string</qlir:tracingId>

<qlir:timeStamp>2008-09-28T18:49:45</qlir:timeStamp>

<qlir:instanceId>string</qlir:instanceId>

<qlir:timeToLive>3</qlir:timeToLive>

<qlir:payloadVersion>string</qlir:payloadVersion>

</qlir:EAIHeader>

<!--Zero or more repetitions:-->

{ for $var1 in $body/sfd:QLIRequestElement/sfd:inRequest/sfd:LineItems return

<qlir:LineItem>

<qlir:UOM>{fn:concat($var1/sfd:listprice/text(),"-", $var1/sfd:Quantity/text(),"-",$var1/sfd:MaterialId/text(),"-",$var1/sfd:Netunitprice/text())}</qlir:UOM>

</qlir:LineItem>

}

<qlir:Quote_refnum>{$body/sfd:QLIRequestElement/sfd:inRequest/sfd:ObjectId/text()}</qlir:Quote_refnum>

</qlir:inRequest>

</qlir:QLIRequest>


Analyze the result:



In fact I have replaced the entire body replace with an XML template containing Xquery Expressions.You may try a different approach of generating an XSLT using Jdeveloper and user XSLT resources to map.

Alternately you can create an XQuery( .xq )mapper file out of Eclipse with OEPE Plug-in for OSB.

Friday, 25 October 2013

OSB Dashboard Monitoring | OSB Service Health

OSB Dashboard Monitoring.

In order to Monitor your Deployed Services and get their statistics in tabular format ,you would need to enable the monitoring in your Proxy service and Business services.

  • Project Explorer >> Select  your <proxy_service>  >> Operational Settings >> Monitoring >> Enable Pipeline Monitoring

  • Save and Activate your Changes




  •  Project > Select your <business_service>  >> Operational Settings  >> Monitoring   >> Enable Pipeline Monitoring

  • Save and Activate your Changes.




OSB Dashboard Monitoring helps to monitor the health of the Deployed Services like the Proxy Services[that does the Routing and Validation] and the Business Services[configured against External end Systems].

This information can be gathered using Service Health Tab under Operations > Dashboard > Service Health



The below Statistics shows:

Average Response Time – The average response time associated with each service deployed.

Messages – the Total count of messages that is inbound to proxy and outbound from Business Service.

Error – Count of Error Transactions.

Status of End Point – whether Online/Offline



 

Thursday, 17 October 2013

Parsing XML element with Attribute names,using XPath in OSB

Parsing XML element with Attribute names,using XPath in OSB ,Say <Element_01 Name="attribute"></Element_01>

<?xml version="1.0" encoding="UTF-8"?>
<?CRM-Property-Set EscapeNames="false"?>
<CRMMessage MessageId="Rhombus_31275" IntObjectFormat="CRM Hierarchical" MessageType="Integration Object" IntObjectName="RCRM Interface Activity External">
<RCRMInterface InterfaceEvent="Insert" SenderSysUID = "Rhombus_Alert_123158" SenderSys = "Rhombus" TransmitTime = "10/03/2013 11:35:19" ReceiverSys="MyCompany CRM" ReceiverSysUID="">

</RCRMInterface>
</CRMMessage>

Solution

· Receive the message in body variable.

·To extract: 123158

Xpath:

  • $body/RCRMInterface/Object/InterfaceActivity/Element_01[@Name="AlertId"]/text()

  • $body/RCRMInterface/Object/InterfaceActivity/Element_01/text()


· To extract Same with tag name: <Element_01 Name="AlertId">123158</Element_01>

Xpath:

  •  $body/RCRMInterface/Object/InterfaceActivity/Element_01

Using fn-bea:inlinedXML in OSB to parse XML Text

Using  fn-bea:inlinedXML in OSB to parse XML Text

fn-bea:inlinedXML in OSB

Consider a scenario where in you expect an XML String from the target application.

In case you find it challenging to use the Xpath to parse the XML string and retrieve value from a particular node the, Xquery function fn-bea:inlinedXML in OSB may be used to Parses textual XML and returns an instance of the XQuery 1.0 Data Model.In simple terms ,parse from xml string to xml Element that can be processed by the parser.

A working example is shown below, where I receive an XML String from end system $body,which is converted to an XML object,using the fn-bea:inlinedXML.Just make sure that your XML string is valid with proper tags and namespace declaration.



[caption id="attachment_199" align="alignnone" width="620"]image0011 OSB Assign Statement[/caption]






image0022

Once done the Xpath expression can be applied on $MyVar for Parsing the DOM Structure.
Ø $MyVar/RCRMInterface/Object/InterfaceActivity/ActivityID/text()

-Ritz

Friday, 4 October 2013

OSB automatic lock issue: ConfigFwk:390105

Having encountered this issue in DEV, thought of sharing the same:

OSB automatic lock issue: ConfigFwk:390105

When developing some services in the OSB from Eclipse or directly from  the sbconsole. ,You get below error while activating your changes to the session
[ConfigFwk:390105]Unable to create WLS change list due to a short term automatic lock obtained by user weblogic. The user has no pending changes and the lock will expire in -1.311.836.889 seconds. Please try again after the lock has expired.

As per online blog:To resolve the issue go to your middelware/domain directory (eg user_projects/domains/osb_domain) and remove or rename the *.lok files. (close your weblogic server first of course)



· Alternate option: Tried this and worked

Issue:



Resolution:

· Check your Weblogic for any existing Activated session,if yes please Activate changes .


· Try again to Activate the OSB session

RIJOY

OSB Message Report : The server encountered an unexpected condition which prevented it from fulfilling the request.

ISSUE: osbconsole>Operations > Message Reports

console exception

Unable to retrieve OSB reporting data on osb console:


Message : The server encountered an unexpected condition which prevented it from fulfilling the request.

Possible cause:

· By default, the Oracle Service Bus JMS reporting provider is deployed in an Oracle Service Bus domain. The reporting provider uses a database to persist reporting data. This is specified under the DataSource wlsbjmsrpDataSource

· Check whether the Datasource os properly targeted to a running server/Adminserver.

· Use the Testing Tab to check whether the database connection specified by dataSource.



In case the test fails:

· Navigate to Weblogic console path for wlsbjmsrpDataSource

· Home >Summary of Servers >Summary of JDBC Data Sources >wlsbjmsrpDataSource

· Manually bounce the instances of this datasource using Shut down followed by Start



Ensure the start is complete and test the data source connection: Once test is successful..



Check the Reports on osb console by Navigating to Operations > Message Reports..You should be able to find the Summary of Message Report screen coming up now.



RIJOY