2 Replies Latest reply on Jan 14, 2014 4:53 PM by 1024879

    insertMissingToData X order of elements

    1024879

      Hi friends!

       

      Is anyone able to help me with this issue?

       

      I have a to assign an element to another with insertMissingToData enabled, but the order of the elemets is not right ather the assignment, I've made a small poc to make it easier to understand:

       

      Here is the schema (source and target variable are of this type):

        <xsd:complexType name="Test">

                      <xsd:sequence>

                          <xsd:element name="a" type="xsd:string" />                 

                          <xsd:element name="b" type="xsd:string" />                   

                          <xsd:element name="c" type="xsd:string" />

                      </xsd:sequence>

                  </xsd:complexType>

        <xsd:element name="test" type="Test"/>

       

      In BPEL Process:


      Source variable:

      <ns1:test xmlns:ns1="http://www.example.org">

         <ns1:a>hi</ns1:a>

         <ns1:b>hi</ns1:b>

         <ns1:c>hi</ns1:c>

      </ns1:test>

       

       

      Target variable:

      <test xmlns:ns1="http://www.example.org" xmlns="http://www.example.org">

         <ns1:a>test</ns1:a>

         <ns1:c>test</ns1:c>

      </test>

       

      Here is the Assign activity, I need to pass "b" element to target schema:

        <assign name="Assign1">

            <copy bpelx:insertMissingToData="yes">

              <from>$inputVariable.payload/ns1:b</from>

              <to>$variableTest/ns1:b</to>

            </copy>

          </assign>

       

       

      Here is the result:

      <test xmlns:ns1="http://www.example.org" xmlns="http://www.example.org">

         <ns1:a>test</ns1:a>

         <ns1:c>test</ns1:c>

         <b>hi</b>

      </test>

       

       

      Can you see the problem? the order of the elements is wrong in the result of the assignment ("a c b" and not "a b c") it seems that insertMissingToData inserts in the final of the sequence elements and not according to XSD.

       

      Does anyone know a feature or workaround to fix this?

       

      Many thanks for considering my request!