Integration

Get Involved. Join the Conversation.

Topic

    Finn Kunas
    ERP Cloud Adapter - fscmRest API capability of using nested...
    Topic posted October 20, 2019 by Finn Kunas, tagged Cloud, ERP Cloud, Integration, PaaS, REST, Web Services 
    29 Views, 2 Comments
    Title:
    ERP Cloud Adapter - fscmRest API capability of using nested response links
    Summary:
    ERP Cloud Adapter capability to fetch attributes from nested links coming in REST represented business objects.
    Content:

    Using the Oracle Integration Cloud I have setup a connection to an existing Oracle Fusion ERP cloud via the out of the box ERP-Cloud connector.

    Accessing the exposed REST-Services (fscmRest Catalog) works fine. Basically I am getting the requested BusinessObjects that I requested via getAll or get operations.

    Most of the businessObjects accessible via REST do have a link section at the bottom, allowing to drill down into the current object further.

    E.g. getAllSalesOrders (/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub) provides the link "lines" in the response payload, which leads me to an array of assigned salesOrderLines. For the lines linkage the URL to drill down further looks similar to: "{domain}/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub/OPS%3A300000077314427/child/lines".

    The lines retrieved by the above mentioned drill-down-call will return me another link called "originalOrderReference", which looks similar to: {domain}/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub/OPS%3A300000077314427/child/lines/00020000000EACED00057708000110D9360A79860000000EACED00057708000110D9360A7987/child/originalOrderReference.

    Following the described chain of links a can drill down perfectly fine using for example postman!

     

    My question now is, if the Oracle Integration Cloud and the out of the box ERP Cloud Adapter is also capable of resolving such a linkage dynamically?

    Setting the connector up, I am able to work with the response structure in later mapping builders, where not only the parent object "salesOrder", but also objects derived via the mentioned links like orderLine and originalOrderReference are availbale for mapping purposes.

    In general this lets me assume it should be able to resolve the nested link, based on the mappings defined later. So if an attribute from within the sales order line is mapped it would have to call the provided link to get to it. Same would go for further nested structures.

    Is my assumtion correct here?

     

    When trying it out (SalesOrder -> SalesOrderLines -> originalOrderReference -> orignialOrderNumber) I do get an error unfortunately that hints towards an invalid xpath:

    {
      "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1",
      "title": "Internal Server Error",
      "detail": "Internal server error. Please contact oracle support for details.",
      "o:errorCode": "500",
      "o:errorDetails": [
        {
          "type": "UnMappedFault:execute",
          "instance": "<![CDATA[Please inspect the logs for more details. Initiating Request: <request_payload/>\n]]>",
          "title": "faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}\nmessageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}\nparts: {{\nsummary=<summary>The &lt;from> value is invalid.\nXpath expression associated with &lt;from> in copy assign activity is invalid.\nThere is an user error that results in missing element value(s) in the xpath query.\nPlease review the payload and modeling to ensure that all elements defined in the &lt;from> xpath query have valid non-null values .\n</summary>\n,activity=<activity>375962-BpAss29-BpSeq6.3-42</activity>\n,query=<query>$messagecontext_130.parameters/../nssrcmpr:getAllResponse/nssrcmpr:items/nsmpr7:lines/nsmpr4:originalOrderReference/nsmpr17:OriginalOrderNumber</query>\n,lineNumber=<lineNumber>1416</lineNumber>}\n",
          "o:errorPath": "NA",
          "o:errorCode": "NA"
        }
      ]
    }

     

    Would be great if you guys could help me out!

    If you need any further information just let me know.

     

    Thanks,

    Finn.

    Version:
    19.3.3.0.0 (190924.1600.31522)

    Comment

     

    • Hemanth Lakkaraju

      Take a look at this.

      So if an attribute from within the sales order line is mapped it would have to call the provided link to get to it.

      You would need to have a separate invoke with dynamic endpoint pointed to the link available in previous response as desired.

      I do get an error unfortunately that hints towards an invalid xpath:

      According to the error, the xpath error is incorrect and doesn't have any data to assign. Please crosscheck the assignment. 

    • Finn Kunas

      Hi Hemanth,

      thanks for you reply.

       

      By the time I figured out, that the ERP Cloud adapter is not automatically expanding the requested payload to contain the later mapped attributes.

      I got this thing working by using the "expand" query parameter for my REST call.

      In reference to the above example, where I am trying to get the originalOrderReference the added query param "?expand=lines.originalOrderReference" did the trick. It works now!

       

      Thanks for your support!