This discussion is archived
7 Replies Latest reply: Nov 29, 2012 6:11 PM by Tarak RSS

getNodes returing Mulitple nodes error

Tarak Newbie
Currently Being Moderated
Hi All,

I am trying to use xpath query getNodes to get the each node from the xml and assign to the variable of type element.

When i ran it i am ending with error as below. I am sure what have give is correct.

XPath query string returns multiple nodes. The assign activity part and query are returning multiple nodes. The assign activity part and query named in the error message returned multiple nodes. It should return single node. According to BPEL4WS specification 1.1 section 14.3, the assign activity part and query named in the error message should not return multiple nodes. Verify the part and xpath query named in the error message at line number 203 in the BPEL source.

Could some one please help me here.

My assign activity
<assign name="Asg_getNodesReceipt">
      <copy>
        <from expression="ora:getNodes('CtReceivingUpload','/ns14:receipts/ns14:receipt[$count]')"/>
        <to variable="receipttest" query="/ns14:receipt"/>
      </copy>
    </assign>
receipttest is the variable of element type receipt.

XSD is here :-
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd"
            targetNamespace="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd"
            elementFormDefault="qualified">
  <xsd:element name="receipts">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="unbounded" ref ="receipt"/>
    </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="receipt">
  <xsd:complexType>
  <xsd:complexContent mixed="false">
  <xsd:extension base="InterfaceEntity">
  <xsd:sequence>
  <xsd:element minOccurs="0" maxOccurs="1" name="Appointment" type="Appointment"/>
 <xsd:element minOccurs="0" maxOccurs="1" name="ArrivedDate" type="xsd:dateTime"/>
 <xsd:element minOccurs="0" maxOccurs="1" name="InternalRecNum" type="xsd:int"/>
 <xsd:element minOccurs="0" maxOccurs="1" name="ReceiptId" type="xsd:string"/>
 <xsd:element minOccurs="0" maxOccurs="1" name="ReceiptType" type="xsd:string"/>
 <xsd:element minOccurs="0" maxOccurs="1" name="Details" type="ReceiptDetailList"/>
 <xsd:element minOccurs="0" maxOccurs="1" name="ReceiptContainers" type="ReceiptContainerList"/>
 </xsd:sequence>
 </xsd:extension>
 </xsd:complexContent>
 </xsd:complexType>
 </xsd:element>
 <xsd:complexType name="Appointment">
 <xsd:sequence>
 <xsd:element minOccurs="0" maxOccurs="1" name="ApptDateTime" type="xsd:dateTime"/>
 </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="ReceiptDetailList">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="ReceiptDetail" nillable="true" type="ReceiptDetail"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ReceiptDetail">
<xsd:complexContent mixed="false">
<xsd:extension base="InterfaceEntity">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="ErpOrderNum" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="SKU" type="SKU"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="SKU">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="Item" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="ReceiptContainerList">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="ReceiptContainer" nillable="true" type="ReceiptContainer"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ReceiptContainer">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="ContainerId" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="ReceiptDetail" type="ReceiptDetail"/>
<xsd:element minOccurs="0" maxOccurs="1" name="Qty" type="xsd:decimal"/>
<xsd:element minOccurs="0" maxOccurs="1" name="Status" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="InterfaceEntity">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef1" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef2" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef3" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef4" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef5" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef6" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef7" type="xsd:decimal"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserDef8" type="xsd:decimal"/>
<xsd:element minOccurs="0" maxOccurs="1" name="UserStamp" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="appt_nbr" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
 </xsd:schema>
 
XML is here:-
<receipts xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd" xmlns="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd"><ns6:receipt><ns6:appt_nbr>N</ns6:appt_nbr><ns6:ArrivedDate>2012-11-28T15:31:40</ns6:ArrivedDate><ns6:InternalRecNum>1001473</ns6:InternalRecNum><ns6:ReceiptId>16173</ns6:ReceiptId><ns6:ReceiptType>ASN</ns6:ReceiptType><ns6:Details><ns6:ReceiptDetail><ns6:UserDef3>10000</ns6:UserDef3><ns6:UserDef7>1.00000</ns6:UserDef7></ns6:ReceiptDetail><ns6:ReceiptDetail><ns6:UserDef3>10000</ns6:UserDef3><ns6:UserDef7>1.00000</ns6:UserDef7></ns6:ReceiptDetail></ns6:Details><ns6:ReceiptContainers><ns6:ReceiptContainer><ns6:ContainerId>00099999990000017444</ns6:ContainerId><ns6:ReceiptDetail><ns6:ErpOrderNum>421431</ns6:ErpOrderNum><ns6:SKU><ns6:Item>5602001</ns6:Item></ns6:SKU></ns6:ReceiptDetail><ns6:Qty>170.00000</ns6:Qty><ns6:Status>900</ns6:Status></ns6:ReceiptContainer><ns6:ReceiptContainer><ns6:ContainerId>00099999990000017433</ns6:ContainerId><ns6:ReceiptDetail><ns6:ErpOrderNum>421431</ns6:ErpOrderNum><ns6:SKU><ns6:Item>5602060</ns6:Item></ns6:SKU></ns6:ReceiptDetail><ns6:Qty>118.00000</ns6:Qty><ns6:Status>900</ns6:Status></ns6:ReceiptContainer></ns6:ReceiptContainers></ns6:receipt><ns6:receipt><ns6:appt_nbr>Y</ns6:appt_nbr><ns6:ArrivedDate>2012-11-28T15:33:41</ns6:ArrivedDate><ns6:InternalRecNum>1001474</ns6:InternalRecNum><ns6:ReceiptId>16174</ns6:ReceiptId><ns6:ReceiptType>ASN</ns6:ReceiptType><ns6:Details><ns6:ReceiptDetail><ns6:UserDef3>10000</ns6:UserDef3><ns6:UserDef7>1.00000</ns6:UserDef7></ns6:ReceiptDetail><ns6:ReceiptDetail><ns6:UserDef3>10000</ns6:UserDef3><ns6:UserDef7>1.00000</ns6:UserDef7></ns6:ReceiptDetail></ns6:Details><ns6:ReceiptContainers><ns6:ReceiptContainer><ns6:ContainerId>00099999990000017466</ns6:ContainerId><ns6:ReceiptDetail><ns6:ErpOrderNum>421431</ns6:ErpOrderNum><ns6:SKU><ns6:Item>5602182</ns6:Item></ns6:SKU></ns6:ReceiptDetail><ns6:Qty>75.00000</ns6:Qty><ns6:Status>900</ns6:Status></ns6:ReceiptContainer><ns6:ReceiptContainer><ns6:ContainerId>00099999990000017455</ns6:ContainerId><ns6:ReceiptDetail><ns6:ErpOrderNum>421431</ns6:ErpOrderNum><ns6:SKU><ns6:Item>5602078</ns6:Item></ns6:SKU></ns6:ReceiptDetail><ns6:Qty>138.00000</ns6:Qty><ns6:Status>900</ns6:Status></ns6:ReceiptContainer></ns6:ReceiptContainers></ns6:receipt></receipts>
I am happy if someone point out where i went wrong here.

Edited by: Tarak on Nov 29, 2012 6:36 PM
  • 1. Re: getNodes returing Mulitple nodes error
    vladodias Guru
    Currently Being Moderated
    Hi Tarak,

    I didn't really get why you're using getNodes in this case... Why not getVariableData?

    May the following will work for your case...
    <assign name="Asg_getNodesReceipt">
          <copy>
            <from variable="CtReceivingUpload" query="/ns14:receipts/ns14:receipt[$count]"/>
            <to variable="receipttest"/>
          </copy>
        </assign>
    Cheers,
    Vlad
  • 2. Re: getNodes returing Mulitple nodes error
    Tarak Newbie
    Currently Being Moderated
    Hi Vald,
    Thanks for the reply.

    Let me now explain you what i am trying to achieve. As per my understanding getNodes give the node list and getvariable gives the node value.

    Using getNodes function what i am trying to achieve here is , in my process i need to split each record in the xml message and have to publish to target for this case we can go with while loop iterations and can publish each node vise in the full message. But i am thinking to use FlowN so that based on the receiptcount dynamically i can publish on to the target. But to this i need to split the total message in to parts so that in each flow tranformation which route to target format xml and will publish to target.

    But i will you solution and will post the result in few mins.

    Let me know if my understanding is correct here

    Regards,
    Tarak
  • 3. Re: getNodes returing Mulitple nodes error
    Tarak Newbie
    Currently Being Moderated
    Hi vald,

    I am extremely sorry by mistake i click helpful and suppose to be correct. I am not sure i can revert it.If you know it please let me know.

    Coming to this. I am getting it as expected but only problem is i am getting namespace url in each complextype element , i am sure it would not be any issue but just want to cross check with you that we can avoid this or not

    here is output
    <receipt><receipt xmlns="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd"><ns6:appt_nbr xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd">N</ns6:appt_nbr><ns6:ArrivedDate xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd">2012-11-28T15:31:40</ns6:ArrivedDate><ns6:InternalRecNum xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd">1001473</ns6:InternalRecNum><ns6:ReceiptId xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd">16173</ns6:ReceiptId><ns6:ReceiptType xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd">ASN</ns6:ReceiptType><ns6:Details xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd"><ns6:ReceiptDetail><ns6:UserDef3>10000</ns6:UserDef3><ns6:UserDef7>1.00000</ns6:UserDef7></ns6:ReceiptDetail><ns6:ReceiptDetail><ns6:UserDef3>10000</ns6:UserDef3><ns6:UserDef7>1.00000</ns6:UserDef7></ns6:ReceiptDetail></ns6:Details><ns6:ReceiptContainers xmlns:ns6="http://www.manh.com/Custom/SOA/CtReceivingDownload/CtReceivingDownload.xsd"><ns6:ReceiptContainer><ns6:ContainerId>00099999990000017444</ns6:ContainerId><ns6:ReceiptDetail><ns6:ErpOrderNum>421431</ns6:ErpOrderNum><ns6:SKU><ns6:Item>5602001</ns6:Item></ns6:SKU></ns6:ReceiptDetail><ns6:Qty>170.00000</ns6:Qty><ns6:Status>900</ns6:Status></ns6:ReceiptContainer><ns6:ReceiptContainer><ns6:ContainerId>00099999990000017433</ns6:ContainerId><ns6:ReceiptDetail><ns6:ErpOrderNum>421431</ns6:ErpOrderNum><ns6:SKU><ns6:Item>5602060</ns6:Item></ns6:SKU></ns6:ReceiptDetail><ns6:Qty>118.00000</ns6:Qty><ns6:Status>900</ns6:Status></ns6:ReceiptContainer></ns6:ReceiptContainers></receipt></receipt>
    Regards,
    Tarak
  • 4. Re: getNodes returing Mulitple nodes error
    vladodias Guru
    Currently Being Moderated
    Tarak wrote:
    I am extremely sorry by mistake i click helpful and suppose to be correct. I am not sure i can revert it.If you know it please let me know.
    No worries, mate. I don't thinks it's revertible. You can mark this one as correct then...
    Coming to this. I am getting it as expected but only problem is i am getting namespace url in each complextype element , i am sure it would not be any issue but just want to cross check with you that we can avoid this or not
    It won't be a problem, visualization looks ugly but it shouldn't affect anything else... I don't think it's avoidable anyway...

    Cheers,
    Vlad
  • 5. Re: getNodes returing Mulitple nodes error
    Tarak Newbie
    Currently Being Moderated
    Hi Vald,

    Thanks a lot champ. I marked this as Answer :-). Could you please let me how gud to go with flowN activity. Any performance problem if the parallelism goes to 50 at the same time ?

    Regards,
    Tarak.
  • 6. Re: getNodes returing Mulitple nodes error
    vladodias Guru
    Currently Being Moderated
    Tarak wrote:
    Could you please let me how gud to go with flowN activity. Any performance problem if the parallelism goes to 50 at the same time ?
    I've never used myself... If you have the chance, do a stress test and let us know...
  • 7. Re: getNodes returing Mulitple nodes error
    Tarak Newbie
    Currently Being Moderated
    Hi Vald,

    Thanks a lot for bringing me out. Definitely i post the stress results

    Regards,
    Tarak

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points